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

Component crashes on some actions when selected={dateString}

Open borisgelbshtein-aps opened this issue 2 months ago • 0 comments

When the component is used with selected property set to string, not Date object, some actions in date-time or time-only modes like choosing date, opening times list second time, etc, produce an error d.getFullYear() is not a function.

The error is in this line, where value of selected is considered a date object if it is not empty. https://github.com/Hacker0x01/react-datepicker/blob/3da627ea6c8da28672d61fdc849e881d703ce636/src/time.tsx#L217

borisgelbshtein-aps avatar Oct 27 '25 19:10 borisgelbshtein-aps