Typed input sets the year back to 2001
Describe the bug When typing, the year flips from current year to 2001.
To Reproduce On Chrome (MacOS)... From the React DatePicker Examples page in the uppermost Default picker, if the current date is Jan-Aug (a single digit month) and we overwrite and type in "9/1", the year will flip from the current year to 2001.
Expected behavior Because today is in 2022, I expect the year to stay as 2022 when I type "9/1".
Issue seen in Chrome on MacOS. Unable to reproduce on Safari and Firefox.
Maybe related to https://github.com/Hacker0x01/react-datepicker/issues/3244?
I suspect it could be the line below causing this behavior
https://github.com/Hacker0x01/react-datepicker/blob/a3596272736e671cfec13e5b73b76186b387fe77/src/date_utils.js#L124
It seems like the value is passed to new Date in some cases and a construct such as new Date("feb 2") would be a February in 2001 (probably feb 2, 2001) on Chrome. At least that's what my test show.
This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 10 days.
Is there a good workaround that takes different date formats into account?
This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 10 days.
This issue was closed because it has been stalled for 10 days with no activity.