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
The typescript definition file shows that .isAfter() takes a Date as an argument but it seems that it really wants a string. After passing it a date using the following:
req.assert('start_date', "Please select a valid start date").optional().isDate().isAfter(unixToDate(minTimestamp));
I get the following error:
TypeError: This library (validator.js) validates strings only
at assertString (*/node_modules/express-validator/node_modules/validator/lib/util/assertString.js:9:11)
at toDate (*/node_modules/express-validator/node_modules/validator/lib/toDate.js:15:30)
at Object.isAfter (*/node_modules/express-validator/node_modules/validator/lib/isAfter.js:22:41)
at Object.validator.(anonymous function) [as isAfter] (*/node_modules/express-validator/lib/express_validator.js:13:15)
at ValidatorChain.isAfter (*/node_modules/express-validator/lib/express_validator.js:469:41)
The text was updated successfully, but these errors were encountered:
The typescript definition file shows that
.isAfter()
takes aDate
as an argument but it seems that it really wants a string. After passing it a date using the following:I get the following error:
The text was updated successfully, but these errors were encountered: