palantir/blueprint
View on GitHubDateRangeInput2 TimePicker does not appear to respect minimum datetime
Open
#5859 opened on Jan 20, 2023
P2Package: datetimeType: bughelp wanted
Description
Environment
- Package version(s): v4.14.2
- Operating System: macOS Ventura
- Browser name and version: Chrome v109.0.5414.87
Code Sandbox
https://codesandbox.io/s/daterangeinput2-example-iwv0ln?file=/src/DateRangeInput2Example.tsx
Steps to reproduce
- On DateRangeInput2, set
minDateand time pickerminTimevalues to equal current time. - Select a date range in the popover
- Observe that the min date and time is respected in the popover while the
minTimevalue is ignored in the subsequent value produced by the onChange handler if the time value is not changed.
https://user-images.githubusercontent.com/2968519/213801179-0ecaa359-8ead-47eb-929c-4216bb0457d2.mp4
Actual behavior
When selecting a date range, the time always defaults to 12:00AM of the selected day which is often out of range if the minimum date time is set to the current time.
Expected behavior
I expected both the date and time to respect the minDate property since it is provided as a Date (which includes time). This would be helpful, for example, to constrain the range selection to both a minimum day and specific time (e.g. "Jan 20th after 12:00PM)