Skip to content

Commit bc16638

Browse files
author
Matt Lewis
committed
test: fix tests for users with different timezones
Fixes #224
1 parent 0ea6bd1 commit bc16638

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

test/calendarMomentDateFormatter.provider.spec.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import {
44
} from '@angular/core/testing';
55
import { expect } from 'chai';
66
import * as moment from 'moment';
7+
import startOfDay from 'date-fns/start_of_day';
78
import {
89
CalendarMomentDateFormatter,
910
MOMENT
@@ -50,7 +51,7 @@ describe('calendarMomentDateFormatter provider', () => {
5051
});
5152

5253
it('dayViewHour', () => {
53-
expect(dateFormatter.dayViewHour({date: new Date('2016-01-01'), locale: 'en'})).to.equal('12am');
54+
expect(dateFormatter.dayViewHour({date: startOfDay(new Date('2016-01-01')), locale: 'en'})).to.equal('12am');
5455
});
5556

5657
it('dayViewTitle', () => {

test/calendarNativeDateFormatter.provider.spec.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import {
33
TestBed
44
} from '@angular/core/testing';
55
import { expect } from 'chai';
6+
import startOfDay from 'date-fns/start_of_day';
67
import {
78
CalendarNativeDateFormatter
89
} from './../src';
@@ -45,7 +46,7 @@ describe('calendarNativeDateFormatter provider', () => {
4546
});
4647

4748
it('dayViewHour', () => {
48-
expect(dateFormatter.dayViewHour({date: new Date('2016-01-01'), locale: 'en'})).to.equal('12 AM');
49+
expect(dateFormatter.dayViewHour({date: startOfDay(new Date('2016-01-01')), locale: 'en'})).to.equal('12 AM');
4950
});
5051

5152
it('dayViewTitle', () => {

0 commit comments

Comments
 (0)