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:
Torkel Ödegaard
2015-09-18 15:06:08 +02:00
parent febe56b062
commit 96b0e70ddd
11 changed files with 39 additions and 43 deletions

View File

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