Skip to content

date/dateISO do not check days of month correctly #1861

Closed
@jmp909

Description

@jmp909

as of here: https://jqueryvalidation.org/dateISO-method/

both of these dates don't validate correctly, they should fail

2011-11-31
2011-02-29

normally i would use this which checks the data parsed from the input string matches the supplied date

var d = new Date(Date.parse(str))
return str === (d.getFullYear() + '-' + (d.getMonth()+1) + '-' + d.getDate());

since 2011-02-29 would parse as 2011-03-01, then this would fail properly

please advise

thanks
J

Metadata

Metadata

Assignees

No one assigned

    Labels

    staleUsed to mark stale issues

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions