Blueprint: [DateRangePicker] Custom shortcuts shorter than 1 day don't work when using TimePrecision.SECONDS

Created on 29 Nov 2018  路  2Comments  路  Source: palantir/blueprint

Environment

  • __Package version(s)__: @blueprintjs/core 3.9.0, @blueprintjs/datetime 3.4.0
  • __Browser and OS versions__: Chrome Version 70.0.3538.110 (Official Build) (64-bit), macOS High Sierra 10.13.6

Steps to reproduce

  1. Open https://codesandbox.io/s/105080ojo3.
  2. Open the date range picker and click on the shortcuts on the left.

Actual behavior

  1. Shortcuts whose duration is less than 1 day don't work. i.e. the "Past 10 Minutes" and "Past 10 Hours" shortcuts in the demo don't work, while the "Past Day" and "Past 10 Days" shortcuts work as expected.

Expected behavior

  1. All shortcuts should update the input value to the corresponding time range.

Possible solution

This feels like a natural thing to support when timePrecision is set to SECONDS. Or we can at least make it clearer in the docs that DateRangePicker doesn't support this.

Additionally: can we add an option to the interactive docs to change the time precision?

datetime bug help wanted

Most helpful comment

Cool, I can submit a patch this week or next.

All 2 comments

@yixunx hmm this is not the intended usage of the DRP shortcuts since it's primarily about dates. but i suppose it makes sense to support. got a change to submit a PR?

Cool, I can submit a patch this week or next.

Was this page helpful?
0 / 5 - 0 ratings