Commit e46814ba by Mitsuhiro Tanda Committed by Torkel Ödegaard

fix date test (#9811)

parent 799aaf72
...@@ -48,7 +48,7 @@ describe("DateMath", () => { ...@@ -48,7 +48,7 @@ describe("DateMath", () => {
it("now/d on a utc dashboard should be start of the current day in UTC time", () => { it("now/d on a utc dashboard should be start of the current day in UTC time", () => {
var today = new Date(); 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(); var startOfDay = dateMath.parse('now/d', false, 'utc').valueOf();
expect(startOfDay).toBe(expected.getTime()); expect(startOfDay).toBe(expected.getTime());
......
...@@ -114,7 +114,7 @@ describe('date time formats', function() { ...@@ -114,7 +114,7 @@ describe('date time formats', function() {
it('should format as US date', function() { it('should format as US date', function() {
var str = kbn.valueFormats.dateTimeAsUS(1505634997920, 1); 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() { it('should format as US date and skip date when today', function() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment