瀏覽代碼

fix moment.js deprecation warning when running tests

Dan Cech 8 年之前
父節點
當前提交
2361e2ddd9
共有 1 個文件被更改,包括 3 次插入3 次删除
  1. 3 3
      public/app/plugins/panel/heatmap/specs/renderer_specs.ts

+ 3 - 3
public/app/plugins/panel/heatmap/specs/renderer_specs.ts

@@ -81,8 +81,8 @@ describe('grafanaHeatmap', function () {
               getTimezone: sinon.stub().returns('utc')
             },
             range: {
-              from: moment.utc("01 Mar 2017 10:00:00"),
-              to: moment.utc("01 Mar 2017 11:00:00"),
+              from: moment.utc("01 Mar 2017 10:00:00", 'DD MMM YYYY HH:mm:ss'),
+              to: moment.utc("01 Mar 2017 11:00:00", 'DD MMM YYYY HH:mm:ss'),
             },
           };
 
@@ -263,5 +263,5 @@ function getTicks(element, axisSelector) {
 
 function formatLocalTime(timeStr) {
   let format = "HH:mm";
-  return moment.utc(timeStr).local().format(format);
+  return moment.utc(timeStr, 'DD MMM YYYY HH:mm:ss').local().format(format);
 }