Commit fea6b970 by Torkel Ödegaard

Some prep work for using today as relative time, #1186

parent 7e82626b
...@@ -168,14 +168,22 @@ function($, _, moment) { ...@@ -168,14 +168,22 @@ function($, _, moment) {
if(_.isDate(text)) { if(_.isDate(text)) {
return text; return text;
} }
var time,
mathString = "", var time;
index, var mathString = "";
parseString; var index;
var parseString;
if (text.substring(0,3) === "now") { if (text.substring(0,3) === "now") {
time = new Date(); time = new Date();
mathString = text.substring("now".length); mathString = text.substring(3);
} else { }
else if (text.substring(0,5) === 'today') {
time = new Date();
time.setHours(0,0,0,0);
mathString = text.substring(5);
}
else {
index = text.indexOf("||"); index = text.indexOf("||");
parseString; parseString;
if (index === -1) { if (index === -1) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment