Skip to content

Validation .isValid() doesn't work always #320

Description

@dakshshah96

The .isValid() validation doesn't function correctly under the following condition:

  • When the the day part is 31 for a month which didn't have 31 days.

Some instances where .isValid() returns true for a date that is invalid:

  • dayjs().isValid('1995-02-31')
  • dayjs().isValid('1995-03-31')
  • dayjs().isValid('1995-04-31')
  • dayjs().isValid('1995-06-31')
  • dayjs().isValid('1995-09-31')
  • dayjs().isValid('1995-11-31')

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions