summaryrefslogtreecommitdiffstats
path: root/web_src/js/webcomponents/absolute-date.test.js
blob: ba04451b6566e648ea33bedfb6b22e3fbab05943 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import {toAbsoluteLocaleDate} from './absolute-date.js';

test('toAbsoluteLocaleDate', () => {
  expect(toAbsoluteLocaleDate('2024-03-15', 'en-US', {
    year: 'numeric',
    month: 'long',
    day: 'numeric',
  })).toEqual('March 15, 2024');

  expect(toAbsoluteLocaleDate('2024-03-15', 'de-DE', {
    year: 'numeric',
    month: 'long',
    day: 'numeric',
  })).toEqual('15. März 2024');
});