Commit 509c3dc7 by utkarshcmu

Fixed time range when using NOW from and to

parent 167c02d7
...@@ -133,14 +133,14 @@ _.each(rangeOptions, function (frame) { ...@@ -133,14 +133,14 @@ _.each(rangeOptions, function (frame) {
return from.fromNow() + ' to ' + formatDate(range.to); return from.fromNow() + ' to ' + formatDate(range.to);
} }
if (!moment.isMoment(range.from) && !moment.isMoment(range.to)) { if (range.to.toString() === 'now') {
return formatDate(dateMath.parse(range.from, true)) + ' to ' + formatDate(dateMath.parse(range.to, true));
}
var res = describeTextRange(range.from); var res = describeTextRange(range.from);
return res.display; return res.display;
} }
return range.from.toString() + ' to ' + range.to.toString();
}
export = { export = {
getRelativeTimesList: getRelativeTimesList, getRelativeTimesList: getRelativeTimesList,
describeTextRange: describeTextRange, describeTextRange: describeTextRange,
......
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