Open dabrad26 opened 4 months ago
hey @dabrad26 ! Thank you for reporting this, could you recreate the issue on stackblitz
Essentially the type info is wrong. The Date picker doesn't want to work with Strings and number (which is documented in Carbon) but needs a Date class for value, min, max...).
This is most likely coming from flatpickr that the DatePicker component is using.
https://stackblitz.com/edit/github-u4drws?file=src%2FApp.jsx
Package
@carbon/react
Browser
Safari
Package version
1.62.1
React version
18.3.1
Description
The DatePicker component documents that it takes String or Number for
minDate
ormaxDate
however recently that does not work and it requires a Date class passed in. This was also recently true for thevalue
prop.I have changed out code to convert to Date() before passing into value, minDate or maxDate if set. However the docs and prop validation on Carbon's side need to be updated or the library should do the same conversion (if type of string or number convert to new Date().
I am marking as a higher severity as this was released as a breaking change and could break production usage if not caught. For us QA caught it and we converted to Date.
Reproduction/example
.
Steps to reproduce
Create date picker with value, minDate or maxDate
Suggested Severity
Severity 2 = User cannot complete task, and/or no workaround within the user experience of a given component.
Application/PAL
Aspera
Code of Conduct