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

isValid bug #2607

Open
ParkerOu opened this issue Mar 18, 2024 · 0 comments
Open

isValid bug #2607

ParkerOu opened this issue Mar 18, 2024 · 0 comments

Comments

@ParkerOu
Copy link

Describe the bug

Executed below code.

const dayjs = require('dayjs');

console.log(dayjs('2024-00-02T04:57:02Z').isValid());
console.log(dayjs('2024-02-31T22:03:08Z').isValid());
console.log(dayjs('2024-02-31T22:03:08Z', 'YYYY-MM-DDTHH:mm:ssZ', true).isValid());

result

false
true
true

February 2024 has only 29 days, not 31.
dayjs('2024-02-31T22:03:08Z').isValid() should return false.

Expected behavior

false
false
false

Information

  • Day.js Version [e.g. v1.0.0]: v1.11.10
  • OS: [e.g. iOS]: Ubuntu 20.04, Windows 10
  • Browser [e.g. chrome 62]: Nope. Node.js 18
  • Time zone: [e.g. GMT-07:00 DST (Pacific Daylight Time)]: GMT +00:00
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