mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Merge pull request #2871 from mtanda/prometheus_time_fix
fix prometheus time conversion
This commit is contained in:
commit
0db2d07a1a
@ -271,12 +271,6 @@ function (angular, _, moment, dateMath) {
|
|||||||
|
|
||||||
function getPrometheusTime(date, roundUp) {
|
function getPrometheusTime(date, roundUp) {
|
||||||
if (_.isString(date)) {
|
if (_.isString(date)) {
|
||||||
if (date === 'now') {
|
|
||||||
return 'now()';
|
|
||||||
}
|
|
||||||
if (date.indexOf('now-') >= 0 && date.indexOf('/') === -1) {
|
|
||||||
return date.replace('now', 'now()').replace('-', ' - ');
|
|
||||||
}
|
|
||||||
date = dateMath.parse(date, roundUp);
|
date = dateMath.parse(date, roundUp);
|
||||||
}
|
}
|
||||||
return (date.valueOf() / 1000).toFixed(0);
|
return (date.valueOf() / 1000).toFixed(0);
|
||||||
|
Loading…
Reference in New Issue
Block a user