react-datepicker icon indicating copy to clipboard operation
react-datepicker copied to clipboard

injectTimes items reset the selected date to today.

Open CrucifixArnaud opened this issue 1 year ago • 0 comments

Describe the bug Hello, it seem that selecting a time value passed to the component using injectTimes property reset the current selected date to today.

To Reproduce Steps to reproduce the behavior:

Can be reproduce in the demo example of injectTimes property (https://reactdatepicker.com/#example-inject-specific-times).

  1. Go to https://reactdatepicker.com/#example-inject-specific-times
  2. Select a date and an "default time", e.g. 30 Jan 2024 22h30.
  3. Reopen the datepicker and select an "injectedTimes", e.g. 23h59
  4. See the error, the date is set back to the date of today.

Expected behavior The date should not be updated to today when you click on an injectedTimes, like the default time.

Screenshots

date-bug-with-injected-time

Desktop (please complete the following information):

  • OS: Linux Mint 20.3 Una
  • Browser Firefox, Chromium
  • Version 122.0.1, 122.0.6261.29

CrucifixArnaud avatar Feb 12 '24 15:02 CrucifixArnaud