Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Range Picker date select with showTime option is broken. #48541

Closed
Chingachcook opened this issue Apr 19, 2024 · 1 comment
Closed

Range Picker date select with showTime option is broken. #48541

Chingachcook opened this issue Apr 19, 2024 · 1 comment

Comments

@Chingachcook
Copy link

Reproduction link

Edit on CodeSandbox

Steps to reproduce

  1. Navigate to the page where the range picker component is located. - https://shorturl.at/kr378
  2. Observe the range picker component without the showTime property enabled.
  3. Attempt to select a date range by clicking once on the start date and once on the end date. Note that the selection process requires only two clicks to select both dates.
  4. Enable the showTime property on the range picker component.
  5. Repeat step 3 by attempting to select a date range by clicking once on the start date and once on the end date.
  6. Observe that the selection process now requires two clicks on each date to select both the date and the time, resulting in a total of four clicks to complete the selection of the date range.

Currently when the user select date by clicking once, UI doesn't show correctly that date preselected until time is picked.

What is expected?

Single click on range picker dates working with and without showTime property.

What is actually happening?

Double-click with the showTime property on dates only select dates.

Environment Info
antd 5.16.2
React react
System mac os, ubuntu, windows
Browser chrome, safari, arc
@zombieJ
Copy link
Member

zombieJ commented Apr 19, 2024

It's by design. Year/Month/Date Picker could be certain the selection finish when click the cell but the DateTime date click is not the end.
If you don't want user select time but only show the time in format, just use format instead:

https://stackblitz.com/edit/react-t867ik?file=demo.tsx

@zombieJ zombieJ closed this as completed Apr 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants