mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Some prep work for using today as relative time, #1186
This commit is contained in:
parent
7e82626b17
commit
fea6b970e5
@ -168,14 +168,22 @@ function($, _, moment) {
|
||||
if(_.isDate(text)) {
|
||||
return text;
|
||||
}
|
||||
var time,
|
||||
mathString = "",
|
||||
index,
|
||||
parseString;
|
||||
|
||||
var time;
|
||||
var mathString = "";
|
||||
var index;
|
||||
var parseString;
|
||||
|
||||
if (text.substring(0,3) === "now") {
|
||||
time = new Date();
|
||||
mathString = text.substring("now".length);
|
||||
} else {
|
||||
mathString = text.substring(3);
|
||||
}
|
||||
else if (text.substring(0,5) === 'today') {
|
||||
time = new Date();
|
||||
time.setHours(0,0,0,0);
|
||||
mathString = text.substring(5);
|
||||
}
|
||||
else {
|
||||
index = text.indexOf("||");
|
||||
parseString;
|
||||
if (index === -1) {
|
||||
|
Loading…
Reference in New Issue
Block a user