mirror of
https://github.com/grafana/grafana.git
synced 2025-01-15 19:22:34 -06:00
fix(timepicker): fixed displaying of customk time ranges, #2861
This commit is contained in:
parent
f0f791d226
commit
7dc923a292
@ -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')
|
||||
|
Loading…
Reference in New Issue
Block a user