iamkun / iamkun/dayjs

dayjs format 'YYYY-ww' error

Open
#2,012 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**
```html

dayjs.extend(window.dayjs_plugin_advancedFormat)
dayjs.extend(window.dayjs_plugin_customParseFormat)
dayjs.extend(window.dayjs_plugin_weekOfYear)
dayjs.extend(window.dayjs_plugin_weekYear)
var date = dayjs("2022-31", "YYYY-ww").toDate()
console.log(date); // Sat Jan 01 2022 00:00:00 GMT+0800 (中国标准时间)
console.log(dayjs(date).format('YYYY-ww')); // 2022-01

```

**Expected behavior**
```js
console.log(dayjs(date).format('YYYY-ww')); // 2022-31
```

**Information**
- Day.js Version [e.g. v1.11.4]
- Browser [e.g. chrome 103.0.5060.134]
- Time zone: [e.g. GMT-07:00 DST (Pacific Daylight Time)]

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.