palantir/blueprint

DateRangeInput2 TimePicker does not appear to respect minimum datetime

開放

#5,859 建立於 2023年1月20日

 (0 則留言) (0 個反應) (0 位負責人)TypeScript (2,167 個分叉)batch import
P2Package: datetimeType: bughelp wanted

倉庫指標

星標
 (20,263 顆星)
PR 合併指標
 (PR 指標待抓取)

描述

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

  1. On DateRangeInput2, set minDate and time picker minTime values to equal current time.
  2. Select a date range in the popover
  3. Observe that the min date and time is respected in the popover while the minTime value 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)

Possible solution

貢獻者指南