iamkun / iamkun/dayjs

Incorrect parsing of the text value

Open
#2,938 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
48.7k
Forks
2.5k
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**
Incorrect parsing of the text value "dall-e-3".

```
dayjs('dall-e-3').toDate() - returns a valid Date object
dayjs('dall-e-3').isValid() - returns true
```

If I pass the date template everything works correctly. But in my case I can't use them.
```
dayjs('dall-e-3', 'MM/DD/YYYY').toDate() - returns Invalid Date
dayjs('dall-e-3', 'MM/DD/YYYY').isValid() - returns false
```

**Expected behavior**
I want the data to be checked more thoroughly if I don't specify a date pattern.
```
dayjs('dall-e-3').toDate() - returns Invalid Date
dayjs('dall-e-3').isValid() - returns false
```

**Information**
- Day.js Version 1.11.13
- OS: Windows
- Browser Chrome Version 140
- Time zone: EET

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the reported dayjs('dall-e-3') calls with and without the 'MM/DD/YYYY' pattern. Trace the parsing entry point used when no pattern is supplied and compare its validation behavior. Done means the unformatted value produces an Invalid Date and isValid() returns false, while the documented formatted-date behavior remains unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
backend
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.