validatorjs/validator.js

isISO8601 returns true for an invalid iso8601 date

Open

#2003 aperta il 18 lug 2022

Vedi su GitHub
 (16 commenti) (1 reazione) (1 assegnatario)JavaScript (2253 fork)batch import
good first issue🐛 bug

Metriche repository

Star
 (22.497 star)
Metriche merge PR
 (Merge medio 10h 14m) (2 PR mergiate in 30 g)

Descrizione

Describe the bug When using isISO8601 to check date that looks like iso8601 format, but missing seconds, will return true even though it is an invalid date

Examples Date string such as "2018-09-11T10:16.000Z" will return true. Live sample: https://codesandbox.io/s/wandering-fire-qr6fm6?file=/src/index.js

Additional context Validator.js version: 13.7.0 Node.js version: 16 OS platform: macOS

Guida contributor