Validation .isValid() doesn't work always
See original GitHub issueThe .isValid()
validation doesn’t function correctly under the following condition:
- When the the day part is 31 for a month which didn’t have 31 days.
Some instances where .isValid()
returns true
for a date that is invalid:
dayjs().isValid('1995-02-31')
dayjs().isValid('1995-03-31')
dayjs().isValid('1995-04-31')
dayjs().isValid('1995-06-31')
dayjs().isValid('1995-09-31')
dayjs().isValid('1995-11-31')
Issue Analytics
- State:
- Created 5 years ago
- Reactions:7
- Comments:15 (2 by maintainers)
Top Results From Across the Web
'isValid' is always false - Stack Overflow
I don't want validation only on submit, and I explicitly stated that using the configuration, or at least that is how I understand...
Read more >Part 9, add validation to an ASP.NET Core MVC app
Run the app and navigate to the Movies controller. Select the Create New link to add a new movie. Fill out the form...
Read more >Client-side form validation - Learn web development | MDN
So why do we insist on validating our forms? There are three main reasons: We want to get the right data, in the...
Read more >Hibernate Validator 8.0.0.Final - Jakarta Bean Validation ...
As constraints, object graph validation also works for container elements ... unique identifier according to RFC 4122. null is always valid.
Read more >validate.js
The validator will not be run if the options are falsy. Important! Most validators consider undefined values ( null and undefined ) valid...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Is this an option to validate if date exist?
Why is this still closed? This issue cost me at least 4 hours because it is still broken.