iamkun / iamkun/dayjs

wrong behavior of isoWeekday()

Open
#1,653 2 comments 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**

`dayjs('random srting').isoWeekday()`
returns `7`

**Expected behavior**
It should returns `NaN` (as it do `dayjs('random srting').day()`)

**Information**
- Day.js Version [v1.10.7]
- OS: [linux Mint 20.2]
- Browser [chrome 92.0.4515.159]
- Time zone: [GMT+0300 (Eastern European Summer Time))]

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the two expressions shown in the issue and inspect the isoWeekday() entry point alongside day(). Add a regression test covering an invalid date and verify that isoWeekday() returns NaN, matching the reported expected behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
tooling
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.