Skip to content

dayjs doesn't say that the invalid date is invalid (eg 2025-36-36T14:19:39) (ISO format) #2871

@ghost

Description

Describe the bug
When initializing dayjs with the invalid date (day 40 or month 13), it doesn't say that the date is invalid.

example:

dayjs('2025-13-36T14:19:39')
// Thu, 05 Feb 2026 12:19:39 GMT

Expected behavior
date.isValid should return false.

Information

  • Day.js Version [e.g. v1.11.13]
  • Framework: Nodejs v22.15.0
  • Time zone: GMT+02:00 DST

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