Skip to content

MM > 12 and DD > 31 do not result in invalid date #1935

Closed
@GamerBene19

Description

@GamerBene19

Describe the bug
Executing dayjs("2022-99-99", "YYYY-MM-DD") does result in a valid date.

Expected behavior
Date should be invalid

Information

  • Day.js Version: 1.11.2
  • OS: Arch, up to date
  • Browser: Firefox version 101.0
  • Time zone: CEST

The issue likely affects other possible format strings aswell (e.g. seconds > 60 (in the context of timestamps)), but I have only experienced and tested it with the above format.

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