palantir / blueprint

A React-based UI toolkit for the web
https://blueprintjs.com/
Apache License 2.0
20.67k stars 2.17k forks source link

DateRangePicker minTime maxTime have impact for everyday #5651

Open morela opened 1 year ago

morela commented 1 year ago

Code Sandbox

https://codesandbox.io/s/blueprintjs-block-time-in-past-gt1xb9?file=/src/index.js

Steps to reproduce

  1. Click on input
  2. Select dates range - startDate set to today date and end date somewhere in the future
  3. Try to change time input to some hour in the past (If now is 13 then to pick 12 should be disallowed - it's ok)
  4. Do the same for End Date - entire date is in future but you still can't pick hour and minute which is under today time. In this example 12 will be disallowed again - it's not ok.

Actual behavior

When I set minTime then it will be set for everyday. When I set minDate then it doesn't have impact on time inputs.

2022-10-07_13h18_50

Expected behavior

I want to set date in future without impact of minTime or maxTime I want to set different minTime and maxTime seperatelly for startTime and endTime

tinopetros commented 1 year ago

This one has me torn, because it appears that timePickerProps are passed down to each timePicker, hence minTime is also holding for the right time picker - yet, I cannot think of a use case where this would be useful. I am considering ensuring minTime is only used on the left time picker and maxTime only on the right.

bkuzminski commented 1 year ago

@tinopetros @adidahiya Could also be added possibility to disable seperately left or right time input? Right now we can disable only both.

adidahiya commented 1 year ago

See my comment here: https://github.com/palantir/blueprint/issues/3509#issuecomment-503276758

I think the API should be changed so that timePickerProps.minTime and timePickerProps.maxTime are ignored (deprecated) in favor of the time attached to minDate and maxDate.

Also related: https://github.com/palantir/blueprint/issues/5502

adidahiya commented 1 year ago

@bkuzminski that sounds like a separate request, can you file a new issue for it?

thasner commented 11 months ago

DateRangePicker3 time inputs do not honor minDate/maxDate