Tests now are UTC based to avoid locale conflicts

This commit is contained in:
Giuseppe 2020-11-26 20:48:43 +01:00
parent 32b871e338
commit 4b65792585
1 changed files with 3 additions and 3 deletions

View File

@ -2,14 +2,14 @@ import { expect } from 'chai';
import { DateFormat } from 'util/formatting/date-format';
describe('DateFormat', () => {
const dt = new Date(2020, 0, 2, 3, 4, 5, 6);
const dt = new Date.UTC(2020, 0, 2, 3, 4, 5, 6);
it('should format date', () => {
expect(DateFormat.dStr(dt)).to.eql('2 Jan 2020');
expect(DateFormat.dStr(dt)).to.eql('Jan 2, 2020');
});
it('should format date and time', () => {
expect(DateFormat.dtStr(dt)).to.eql('2 Jan 2020 03:04:05');
expect(DateFormat.dtStr(dt)).to.eql('Jan 2, 2020, 03:04:05 AM');
});
it('should format date and time in sortable format', () => {