dayjs
dayjs copied to clipboard
dayjs("02-29") return “2001-03-01”
Describe the bug In chrome and nodejs, dayjs("02-29") return “2001-03-01”.
Expected behavior I think "02-29" should be a invalid input. In firefox, this cause a error "Invalid Date". It's OK. In chrome, the dafault year "2001" makes it even worse. There is no "2001-02-29", but chrome/v8 makes it to be "2001-03-01". It's certainly wrong. (Maybe also a bug to v8.)
Information
- Day.js Version 1.11.10
- OS: windows 7 - 10
- Browser chrome 109.0.5414.120 - 122.0.6261.95
- Time zone: GMT+0800 Asia/Shanghai
I have observed similar issue. Sending "2/31" is converting it to "3/2". Ideally it should be an invalid input and should throw validation error.