Incorrect work of inValid().
- Dominant language
- JavaScript
- Stars
- 48.7k
- Forks
- 2.5k
- PR merge metrics
- No merged PRs in 30d
Description
**Describe the bug**
Function isValid() worked incorrectly.
F.e.
https://codesandbox.io/s/friendly-bhabha-o755x?file=/src/index.js

1. As you can see, using a strict flag does not help me to validate the date correctly. Or strict flag work some another way, not as 'moment'?
Also, even if I recheck the examples from your site I receive another results:

2. Why do I have a different date in 'dayjs' and 'moment'. As you can see I did not set locale, but "moment" parsed input date like '2012-10-47' as 'Fri Jan 20 2012 00:00:00 GMT+02002', but 'dayjs' parsed the same input date as 'Thu, 15 Nov 2012 22:00:00 GMT'. Why so?
**Expected behavior**
1. const dayjsStrict = dayjs('2012-10-47', 'MMM D, YYYY', true); // false
**Information**
- Day.js Version [e.g. v1.10.6]
- OS: [e.g. Windows]
- Browser [e.g. chrome 93]
- Time zone: [e.g. GMT+3:00 DST (Minsk)]
Contributor guide
Research direction
Start by reproducing the isValid() behavior in the linked CodeSandbox with the strict parsing example and the input '2012-10-47'. Compare the Day.js and Moment results described in the issue; done means the strict example returns false and the intended parsing behavior is clarified or corrected.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- web-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100