Skip to content

Bug in Date validation, isDate() function #1395

@dcjha

Description

@dcjha

Incorrect date formats like YYYY-MM/DD and YYYY/MM-DD which contains both hyphen - and forward slash / are being wrongly validated as true.

validator.isDate("2020-10/12"); // returns true
validator.isDate("2020/10-12");  // returns true

Expected Behavior
I think in such cases, isDate() function should return false

Additional context
Validator.js version:^13.1.1
Node.js version:v12.16.1
OS platform: [windows]

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions