Adding duration object to dayjs object leads to Invalid date.
- Dominant language
- JavaScript
- Stars
- 48.7k
- Forks
- 2.5k
- PR merge metrics
- No merged PRs in 30d
Description
**Describe the bug**
```
const day = dayjs();
console.log(day.format());
const modifiedDay = day.add(dayjs.duration({ days: 1 }));
console.log(modifiedDay.format());
```

This kind of action should be supported according to the dayjs documentation:
https://day.js.org/docs/en/manipulate/add
**Expected behavior**
It should add one day to the object and print the correct result. Instead, it creates an invalid date.
**Information**
- Day.js v1.10.6
- OS: macOS Big Sur (11.5.2)
- Browser: Google Chrome 92.0.4515.159 (Official Build) (x86_64)
- Time zone: Europe/Berlin (we are currently on UTC+02:00)
Contributor guide
Research direction
Start with the provided reproduction using dayjs.add and dayjs.duration, then trace how the duration plugin value is handled by the add API. Confirm the behavior against the documented add example and establish a regression check showing that adding one day produces a valid date.
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
- 42/100