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

pull/2445/merge
Torkel Ödegaard 10 years ago
parent f0f791d226
commit 7dc923a292
  1. 2
      public/app/core/utils/rangeutil.ts
  2. 5
      public/test/specs/core/utils/rangeutil_specs.ts

@ -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…
Cancel
Save