Skip to content

invalid date not working #12

@nilz3155

Description

@nilz3155

Q: How can I check for invalid combination of a year-month-day ?!

when I create a new date with invalid month or day it is transformed to another valid date :

const birthDate = new DateObject({
year: 1942,
month: 84,
day: 55
})

console.log(birthDate.format('YYYY-MM-DD'), birthDate.isValid) //1949-01-24 true
(expected: 1942-84-55, false)

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