fix date test (#9811)

This commit is contained in:
Mitsuhiro Tanda 2017-11-08 19:01:19 +09:00 committed by Torkel Ödegaard
parent 799aaf720a
commit e46814ba05
2 changed files with 2 additions and 2 deletions

View File

@ -48,7 +48,7 @@ describe("DateMath", () => {
it("now/d on a utc dashboard should be start of the current day in UTC time", () => {
var today = new Date();
var expected = new Date(Date.UTC(today.getFullYear(), today.getMonth(), today.getDate(), 0, 0, 0, 0));
var expected = new Date(Date.UTC(today.getUTCFullYear(), today.getUTCMonth(), today.getUTCDate(), 0, 0, 0, 0));
var startOfDay = dateMath.parse('now/d', false, 'utc').valueOf();
expect(startOfDay).toBe(expected.getTime());

View File

@ -114,7 +114,7 @@ describe('date time formats', function() {
it('should format as US date', function() {
var str = kbn.valueFormats.dateTimeAsUS(1505634997920, 1);
expect(str).toBe(moment(1505634997920).format('MM/DD/YYYY H:mm:ss a'));
expect(str).toBe(moment(1505634997920).format('MM/DD/YYYY h:mm:ss a'));
});
it('should format as US date and skip date when today', function() {