瀏覽代碼

Timepicker display fixed for now-*

utkarshcmu 10 年之前
父節點
當前提交
167c02d773
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      public/app/core/utils/rangeutil.ts

+ 4 - 0
public/app/core/utils/rangeutil.ts

@@ -133,6 +133,10 @@ _.each(rangeOptions, function (frame) {
       return from.fromNow() + ' to ' + formatDate(range.to);
     }
 
+    if (!moment.isMoment(range.from) && !moment.isMoment(range.to)) {
+      return formatDate(dateMath.parse(range.from, true)) + ' to ' + formatDate(dateMath.parse(range.to, true));
+    }
+
     var res = describeTextRange(range.from);
     return res.display;
   }