You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
More dbg info, the issue is from lib/isDate.js around line 120.
return new Date("".concat(fullYear, "-").concat(dateObj.m, "-").concat(dateObj.d)).getDate() === +dateObj.d;
in my test, the input is "2020-06-15",
"".concat(fullYear, "-").concat(dateObj.m, "-").concat(dateObj.d) is "2020-06-15T00:00:00.000Z".
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: