iamkun / iamkun/dayjs

Recent typings change breaks .add(1, "week")

Open
#1,897 1 comment 3 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**
When including quarterOfYear plugin, the type of the add function changes from : `add(value: number, unit?: ManipulateType): Dayjs` to `add(value: number, unit: QUnitType): Dayjs` which incorrectly removes `"week" | "weeks" | 'w'` from possibilities.

**Expected behavior**
No type error when calling `dayjs().add(1, "week")`when the quarterOfYear plugin is loaded.

**Information**
- Day.js Version [1.11.2]

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.