mirror of
https://github.com/home-assistant/frontend.git
synced 2025-12-20 02:38:53 +00:00
21 lines
605 B
JavaScript
21 lines
605 B
JavaScript
import { assert } from 'chai';
|
|
|
|
import formatDateTime from '../../../js/common/datetime/format_date_time';
|
|
|
|
describe('formatDateTime', () => {
|
|
const dateObj = new Date(
|
|
2017, 10, 18,
|
|
11, 12, 13, 1400,
|
|
);
|
|
|
|
it('Formats English date times', () => {
|
|
assert.strictEqual(formatDateTime(dateObj, 'en'), 'November 18, 2017, 11:12 AM');
|
|
});
|
|
|
|
// Node only contains intl support for english formats. This test at least ensures
|
|
// the fallback to a different locale
|
|
it('Formats other date times', () => {
|
|
assert.strictEqual(formatDateTime(dateObj, 'fr'), '2017 M11 18 11:12');
|
|
});
|
|
});
|