validatorjs/validator.js

isISO8601 returns true for an invalid iso8601 date

Open

#2,003 opened on 2022幎7月18日

GitHub で芋る
 (16 comments) (1 reaction) (1 assignee)JavaScript (2,253 forks)batch import
good first issue🐛 bug

Repository metrics

Stars
 (22,497 stars)
PR merge metrics
 (平均マヌゞ 10h 14m) (30d で 2 merged PRs)

説明

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

コントリビュヌタヌガむド