mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
feat(timepickerv2): fixed lots of minor issues and updated kairosdb and opentsdb data sources to work with the new date formats
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
import moment = require('moment');
|
||||
import _ = require('lodash');
|
||||
import dateMath = require('./datemath');
|
||||
import dateMath = require('app/core/utils/datemath');
|
||||
import angular = require('angular');
|
||||
|
||||
var spans = {
|
||||
@@ -112,6 +112,10 @@ _.each(rangeOptions, function (frame) {
|
||||
return option.display;
|
||||
}
|
||||
|
||||
if (moment.isMoment(range.from) && moment.isMoment(range.to)) {
|
||||
return formatDate(range.from) + ' to ' + formatDate(range.to);
|
||||
}
|
||||
|
||||
if (moment.isMoment(range.from)) {
|
||||
var toMoment = dateMath.parse(range.to, true);
|
||||
return formatDate(range.from) + ' to ' + toMoment.fromNow();
|
||||
|
||||
Reference in New Issue
Block a user