1
0
mirror of https://github.com/home-assistant/frontend.git synced 2025-12-24 04:39:01 +00:00
Files
frontend/test-mocha/common/util/format_date_time.js
Paulus Schoutsen a960559639 Add eslint mocha options (#671)
* Add eslint mocha options

* Please hound

* Remove deprecated --compiler option
2017-11-24 21:01:15 -08:00

21 lines
604 B
JavaScript

import formatDateTime from '../../../js/common/util/format_date_time';
const assert = require('assert');
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');
});
});