iamkun / iamkun/dayjs

dayjs('99', 'MM').isValid() returns true

Open
#2,475 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
48.7k
Forks
2.8k
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**
As stated, `dayjs('99', 'MM')` creates a valid date in 1999 so `isValid` returns true.

**Expected behavior**
I would expect it to return false.

**Information**
- Day.js Version 1.11.3
- OS: Windows
- Browser: Chrome
- Time zone: GMT +9 Tokyo

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the reported entry point, dayjs('99', 'MM').isValid(), using Day.js 1.11.3 or the current version. Trace how the formatted month input is parsed and determine whether this input should be rejected; done means isValid() returns false for this case without breaking valid formatted dates.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.