iamkun / iamkun/dayjs

Drop parse `yyyy-Wnn` format?

Open
#1,844 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**
Parsing Format `yyyy-Wnn` seems to be missing in the last version

**Expected behavior**

```js
const dayjs = require('dayjs')
const utc = require('dayjs/plugin/utc');
const weekOfYear = require('dayjs/plugin/weekOfYear')
dayjs.extend(weekOfYear);
dayjs.extend(utc);
dayjs.utc('2020-W03').valueOf();
```

`NaN` with `“dayjs”: “^1.11.0"`
but `1577847600000` with `“dayjs”: “^1.10.4"`

I don't see anything relavant in the changelog (but I might be wrong).
Do I miss something? Do I have to add a plugin?

Thanks in advance

**Information**
- Mac OS/X
- Node.js v16.1.0
- Time zone: GMT

Contributor guide

Open the contributing guide

Research direction

Start by running the provided Node.js reproduction with Day.js 1.11.0 and compare its result with 1.10.4. Trace the date-parsing entry point and relevant week or UTC plugins, then verify that parsing `2020-W03` produces the expected timestamp or that the supported usage is clearly documented.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.