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

Changing time is resetting date to current date #4268

Closed
JonathanCaspar opened this issue Sep 20, 2023 · 1 comment · Fixed by #4282 or jones58/personal-knowledge-wiki#29 · May be fixed by rowidanagah/EduMentorMate#9
Closed

Changing time is resetting date to current date #4268

JonathanCaspar opened this issue Sep 20, 2023 · 1 comment · Fixed by #4282 or jones58/personal-knowledge-wiki#29 · May be fixed by rowidanagah/EduMentorMate#9

Comments

@JonathanCaspar
Copy link

Describe the bug
When we manually change the time value, the date value is reset to the current date.

To Reproduce

  1. Considering current date is sept 20th
  2. Pick sept 21th in the calendar picker
  3. Modify the time in the time picker
  4. The date is reset to sept 20th

Expected behavior
Changing the time in the time picker should not alter the selected date

Additional context
Bug seems to have appeared with the release of version 4.18.0.
Had to lock the version to 4.17.0 to fix the problem.

@balajis-qb
Copy link

I've resolved the issue in my PR #4282. Kindly review and let me know if any changes required.

balajis-qb pushed a commit to qburst/react-datepicker-3 that referenced this issue Oct 1, 2023
This commit includes two test cases for the InputTime component

1. It verifies that the component correctly triggers the onChange event when a date prop is provided. The test simulates a change in time input and checks if the expected date, based on the provided date prop and new time, is passed to the onChange function.

2. It ensures that the component gracefully handles the scenario when the date prop is missing. The test simulates a change in time input and checks if the expected date, based on the current date and new time, is passed to the onChange function when no date prop is provided.

Closes Hacker0x01#4268
martijnrusschen added a commit that referenced this issue Oct 1, 2023
…ate-on-time-change

Fix #4268: Retain the selected date when changing the time
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment