Feature request
DateRangePicker is obviously a component mean to have chronologically ordered time selection.
the boundaryToModify prop documentation states this explicitly:
▎ This will be honored unless the next click would overlap the other boundary date. In that case, the two boundary dates will be auto-swapped to keep them in chronological order.
However, the same invariant is not enforced when the user changes a boundary via its TimePicker. With timePrecision set, each boundary has an independent TimePicker; changing the left (start) time to be later than the right (end) time emits [laterDate, earlierDate] from onChange with no normalization.
The two paths diverge in dateRangePicker.tsx:
- Day-click path (handleDayMouseEnter / handleNextState) normalizes via DateUtils.getDateTime + boundary swap logic.
- Time-picker path (handleTimeChange, ~lines 176–186 in v6.0.25) writes the new boundary at dateIndex and immediately calls onChange without ordering the resulting [Date, Date]:
Examples
- Open https://blueprintjs.com/docs/#datetime/date-range-picker
- Check allow single day range
- Select the same day
- Manually edit the before time to be later than the after time
Feature request
DateRangePicker is obviously a component mean to have chronologically ordered time selection.
the boundaryToModify prop documentation states this explicitly:
▎ This will be honored unless the next click would overlap the other boundary date. In that case, the two boundary dates will be auto-swapped to keep them in chronological order.
However, the same invariant is not enforced when the user changes a boundary via its TimePicker. With timePrecision set, each boundary has an independent TimePicker; changing the left (start) time to be later than the right (end) time emits [laterDate, earlierDate] from onChange with no normalization.
The two paths diverge in dateRangePicker.tsx:
Examples