Commit 7dc923a2 by Torkel Ödegaard

fix(timepicker): fixed displaying of customk time ranges, #2861

parent f0f791d2
......@@ -106,7 +106,7 @@ _.each(rangeOptions, function (frame) {
}
}
} else {
opt.display = 'parse error';
opt.display = opt.from + ' to ' + opt.to;
opt.invalid = true;
}
......
......@@ -56,6 +56,11 @@ describe("rangeUtil", () => {
expect(text).to.be('Last 1 hour')
});
it('Date range with rounding ranges', () => {
var text = rangeUtil.describeTimeRange({from: 'now/d+6h', to: 'now'});
expect(text).to.be('now/d+6h to now')
});
it('Date range with absolute to now', () => {
var text = rangeUtil.describeTimeRange({from: moment([2014,10,10,2,3,4]), to: 'now'});
expect(text).to.be('Nov 10, 2014 02:03:04 to a few seconds ago')
......
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