-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[BUG] - Empty DatePicker doesn't accept 31 as day if no month is given. #2913
Comments
jannikdresselhaus
changed the title
[BUG] - Empty dateinput doesn't accept 31 as date if no month is filled out.
[BUG] - Empty DatePicker doesn't accept 31 as date if no month is filled out.
Apr 29, 2024
jannikdresselhaus
changed the title
[BUG] - Empty DatePicker doesn't accept 31 as date if no month is filled out.
[BUG] - Empty DatePicker doesn't accept 31 as day if no month is given.
Apr 29, 2024
This is probably a bug in react-aria that we use in our implementation. This is because there is always a date under the hood, even when the placeholder is displayed. The default is today's date, but you can also set it using the import {CalendarDate} from '@internationalized/date';
<DatePicker
label="Birth date"
placeholderValue={new CalendarDate(2020, 12, 1)}
/> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
NextUI Version
2.3.6
Describe the bug
When there is a datepicker with no value, it is not possible to start with the 31st of the month when inputting via keyboard. Instead, you have to first input a month with 31 days.
For a locale with a day-month-year date format this is unexpected behaviour.
Your Example Website or App
No response
Steps to Reproduce the Bug or Issue
Create a datepicker with no value and try to put in 31 as a day.
Expected behavior
I expect to be able to put in 31 as a day. When I then try to input a month with less than 31 days, the day field should be reset to null.
Screenshots or Videos
Operating System Version
macOS/Ubuntu
Browser
Chrome
The text was updated successfully, but these errors were encountered: