iamkun / iamkun/dayjs

dayjs('2017-52', 'GGGG-WW') & isoWeekYear(2017) both work incorrectly

Open
#2,224 0 comments 1 reaction 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('2017-52', 'GGGG-WW') & dayjs('2017-52', 'YYYY-WW') return the same value as dayjs('2017-52')

- dayjs('2017').isoWeekYear(2017) returns 2016, the same as dayjs('2017')

**Expected behavior**

- dayjs should support the formats 'GGGG' & 'W' & 'w' so that dayjs('2017-52', 'GGGG-WW') works properly

- isoWeekYear/weekYear should support to set value

**which moment had already supported long before**

**Information**
- Day.js Version v1.11.7
- OS: Windows
- Browser: chrome 109
- Time zone: GMT+8

Contributor guide

Open the contributing guide

Research direction

Reproduce the reported calls for GGGG-WW, YYYY-WW, and isoWeekYear(2017), then trace the parsing and week-year APIs involved. Compare the results with the expected Moment.js behavior; done means the listed formats parse correctly and isoWeekYear/weekYear can set the requested value.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.