-
-
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
What is the exact ISO 8601 format for isDate() ? #2336
Comments
More info, i put some console.log at isDate@lib/isDate.js, now for 13.11 the argument input is "2020-06-15", options is undefined |
More dbg info, the issue is from lib/isDate.js around line 120. in my test, the input is "2020-06-15", but its getDate() returns 14 not 15. I don't know how to fix it. |
Ppl in stackoverflow mentioned it works fine in linux and win11. |
Might be this one #2256 |
Describe the bug
isDate("2020-06-15") is failing on 13.11.0, which is called from express-validator.
it used to work on 13.7.0.
const validator = require('validator');
const rt = validator.isDate('2022-06-15');
console.log(rt);
it prints false
Examples
isData("2020-06-15") was working on 13.7.0
I realized there's a change on 13.11.0
#2231
and changed my code to
isDate("2012-03-29T10:05:45-06:00") but still fails.
doesn't like "2012-03-29T10:05:45.000Z" either.
this format is from the online search on ISO 8601 date format
https://www.digi.com/resources/documentation/digidocs/90001488-13/reference/r_iso_8601_date_format.htm
My question is, what's the good example to pass isDate() ? thanks !
Additional context
Validator.js version: 13.11.0
Node.js version: 16.16.0
OS platform: macOS
The text was updated successfully, but these errors were encountered: