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
DatePicker format not as flexible as renderValue, calendar display broken on valid format #3794
Comments
Hi @boriscosic. This is indeed a problem that I didn't consider well. Let me think about how to better support it. If you want to support |
Thanks @simonguo! I was playing with label to set the display using date-fns format, Might be a way to go about it as an option to hide the input field. |
Fixed in v5.61.0. |
@simonguo thanks so much for fixing this! I noticed now the edit doesn't work really well, event after I tried format yyyy-MM-dd. I use 5.37.4 and this behaviour worked really well https://stackblitz.com/edit/react-len85x-4cdj4d?file=index.js,package.json. The header used renderValue function and the input default to yyyy-MM-dd from the format. Any thoughts on reverting to that behaviour if renderValue is provided, rather then using editable={false} Thanks for getting the fix out! |
Fixed in #3815 |
What version of rsuite are you using?
5.60.2
What version of React are you using?
17
What version of TypeScript are you using (if any)?
5
What browser are you using?
Chrome
Describe the Bug
DateRangePicker and DatePicker renderValue could support any format while maintaining the flexible yyyy-MM-dd input field. The format is limitted in functionality and support of date-fns formats https://date-fns.org/v3.6.0/docs/format
For example,
EEE, dd MMM
works for display but it breaks the day selection in the calendar.Expected Behavior
Custom formatting does not break calendar selection.
To Reproduce
<DatePicker format="EEE, d MMM" defaultValue={new Date()} />
The text was updated successfully, but these errors were encountered: