iamkun / iamkun/dayjs

dayjs().add(dayjs.duration()) inconsistency

Open
#2,750 4 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**
https://stackblitz.com/edit/vitejs-vite-rvrdyd?file=main.js

when added a duration which is initialized with weeks, the dayjs.add function does not add any time.

**Expected behavior**
Should give correct output

**Information**
- Day.js Version: 1.11.13
- OS: macOS
- Browser: latest chrome
- Time zone: GMT+05:30

Contributor guide

Open the contributing guide

Research direction

Start by running the linked StackBlitz reproduction in main.js and confirm how a duration initialized with weeks behaves when passed to dayjs().add(). Trace the duration and add handling, then verify that week-based durations produce the expected added time.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
tooling
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.