Reproduction link
Steps to reproduce
- Setup a
DatePicker.RangePicker
component with the propspicker="time"
- Try setting a greater start time value than the end time value on the rendered UI (Ex: Start time = 07:00, End time = 01:00)
What is expected?
User should be able to set a range with a greater start time value than the end time value
What is actually happening?
When setting a start time value that is greater than the end time value, it swaps them automatically
| Environment | Info |
| ------------ | ------------ |
| antd | 5.9.0 |
| React | 17.0.2 |
| System | MacOS Sonoma 14.0 |
| Browser | Arc 1.32.0 Chromium 122.0.6261.94 |
Maybe you could add a props that when set to true
allows users to set a range with a greater start time than the end time
1条答案
按热度按时间7cwmlq891#
I've looked into rc-picker, and it appears there's an option which controls whether the date swap occurs or not. It's called "order" and it is found at the bottom of the RangePicker section in the documentation.
However, the option appears not to be supported by the Ant Design component per se.
Even though the option is not in the Ant Design documentation, it seems to work. Setting
order={false}
disables time re-ordering:Could we have this option added to the Ant Design documentation?