Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

invalid date not working #12

Open
nilz3155 opened this issue Jul 31, 2024 · 0 comments
Open

invalid date not working #12

nilz3155 opened this issue Jul 31, 2024 · 0 comments

Comments

@nilz3155
Copy link

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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant