feat(timepicker): added new relative time option , will set time range to midnight to now, closes #1186

This commit is contained in:
Torkel Ödegaard
2015-08-11 19:16:45 +02:00
parent 82feeff3aa
commit fe093c6385
5 changed files with 42 additions and 18 deletions

View File

@@ -186,7 +186,10 @@ function (angular, _, kbn, InfluxSeries, InfluxQueryBuilder) {
function getInfluxTime(date) {
if (_.isString(date)) {
return date.replace('now', 'now()').replace('-', ' - ');
if (date.indexOf('now') >= 0) {
return date.replace('now', 'now()').replace('-', ' - ');
}
date = kbn.parseDate(date);
}
return to_utc_epoch_seconds(date);