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

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy