Commit 540ee353 by Daniel Lee

timerange: new quick ranges, month and year so far

The new time ranges can also be used for time range overrides in the
override relative time field. E.g. now/M or now/y.
parent e61b3929
......@@ -18,9 +18,11 @@ var rangeOptions = [
{ from: 'now/d', to: 'now/d', display: 'Today', section: 2 },
{ from: 'now/d', to: 'now', display: 'Today so far', section: 2 },
{ from: 'now/w', to: 'now/w', display: 'This week', section: 2 },
{ from: 'now/w', to: 'now', display: 'This week so far', section: 2 },
{ from: 'now/w', to: 'now', display: 'This week so far', section: 2 },
{ from: 'now/M', to: 'now/M', display: 'This month', section: 2 },
{ from: 'now/M', to: 'now', display: 'This month so far', section: 2 },
{ from: 'now/y', to: 'now/y', display: 'This year', section: 2 },
{ from: 'now/y', to: 'now', display: 'This year so far', section: 2 },
{ from: 'now-1d/d', to: 'now-1d/d', display: 'Yesterday', section: 1 },
{ from: 'now-2d/d', to: 'now-2d/d', display: 'Day before yesterday', section: 1 },
......
......@@ -47,6 +47,16 @@ describe("rangeUtil", () => {
var info = rangeUtil.describeTextRange('now/w');
expect(info.display).to.be('This week so far');
});
it('should handle now/M', () => {
var info = rangeUtil.describeTextRange('now/M');
expect(info.display).to.be('This month so far');
});
it('should handle now/y', () => {
var info = rangeUtil.describeTextRange('now/y');
expect(info.display).to.be('This year so far');
});
});
describe("Can get date range described", () => {
......
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