-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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: validation of years with arbitrary number of digits with YYYY is not working #2661
Comments
maxkomarychev
changed the title
bug: validation of 4 digit years with YYYY is not working
bug: validation of years with arbitrary number of digits with YYYY is not working
May 15, 2024
Unable to replicate this issue in Node.js. The custom format requires the "customParseFormat" plugin - are you testing with this plugin imported too? I've written a quick test in Node:
Output:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
Validation does not work properly with the strict flag https://day.js.org/docs/en/parse/is-valid
All these dates are considered valid even though the "YYYY" is used and there are dates which have <4 digits in year:
Expected behavior
A clear and concise description of what you expected to happen.
"YYYY" must only allow 4-digit years per spec
https://day.js.org/docs/en/parse/string-format
Information
The text was updated successfully, but these errors were encountered: