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

Picking a second time for a single day changes the date #6863

Open
evansjohnson opened this issue Jun 25, 2024 · 0 comments · May be fixed by #6858
Open

Picking a second time for a single day changes the date #6863

evansjohnson opened this issue Jun 25, 2024 · 0 comments · May be fixed by #6858

Comments

@evansjohnson
Copy link
Contributor

Environment

  • Package version(s):
  • Operating System: macOs Venture 13.6
  • Browser name and version: Google Chrome Version 118.0.5993.88 (Official Build) (arm64)

Code Sandbox

Link to a minimal repro - can see it in the docs

Steps to reproduce

  1. Enable the time picker (doesn't matter if allowSingleDayRange is on or off)
  2. Click on a single day in the DateRangePicker3
  3. Change its end time

Actual behavior

The second date in the range becomes today's date at the time you selected

Expected behavior

The second date in the range becomes the date you selected at the time you selected. Also, the selection highlighting sometimes looks wrong - the whole month has the pale blue selection and all of the dates in between the date you selected and the current day are dark blue.

Possible solution

The second date in the range is treated as null when only one date has been clicked (or if allowSingleDayRange is on, when only one date has been clicked one time -- if you click it a second time this behavior does not occur). The TimePicker then attempts to modify a null date, so it falls back to today's date based on this line of code. I think changing this so it does something like "grab the date at the other index if this one is null but the time isn't null" would fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant