瀏覽代碼

fix date test (#9811)

Mitsuhiro Tanda 8 年之前
父節點
當前提交
e46814ba05
共有 2 個文件被更改,包括 2 次插入2 次删除
  1. 1 1
      public/app/core/specs/datemath.jest.ts
  2. 1 1
      public/app/core/specs/kbn.jest.ts

+ 1 - 1
public/app/core/specs/datemath.jest.ts

@@ -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());

+ 1 - 1
public/app/core/specs/kbn.jest.ts

@@ -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() {