-
-
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
isISO8601 allows non-existent dates #772
Comments
Ah yes, I was surprised too, that 31. February 2012 became "Fri Mar 02 2012 00:00:00 GMT+0100 (Mitteleuropäische Zeit) {}" which btw is the same one receives from |
On it 👍 |
profnandaa
added a commit
to profnandaa/validator.js
that referenced
this issue
Oct 14, 2018
This commit adds an additional test for dates over and above passing the pattern match. It checks to assertain that the date is a valid date. For examples, dates like 2009-02-29 are caught as invalid. Additionally, it also fixes a minor bug with the `weekDate` that was wrongfully leaving out W53 as an invalid date. fixes validatorjs#772
profnandaa
added a commit
to profnandaa/validator.js
that referenced
this issue
Oct 14, 2018
This commit adds an additional test for dates over and above passing the pattern match. It checks to assertain that the date is a valid date. For examples, dates like 2009-02-29 are caught as invalid. Additionally, it also fixes a minor bug with the `weekDate` that was wrongfully leaving out W53 as an invalid date. fixes validatorjs#772
@LordSputnik @deniercounter - I've raised the PR, let me know what you think - #910 |
profnandaa
added a commit
that referenced
this issue
Oct 15, 2018
* fix: extra validation for dates This commit adds an additional test for dates over and above passing the pattern match. It checks to assertain that the date is a valid date. For examples, dates like 2009-02-29 are caught as invalid. Additionally, it also fixes a minor bug with the `weekDate` that was wrongfully leaving out W53 as an invalid date. fixes #772 * fix: add extra validation for ordinal dates - adds provision for ordinal dates - checks that ordinal dates are also valid for leap years - includes regression tests for previous cases with `strict = false`
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
isISO8601 currently passes non-existent dates such as "2017-06-31" and "2017-02-29". If the day of the month is provided, it should be checked to make sure it's actually valid for the supplied month and year.
The text was updated successfully, but these errors were encountered: