Date Calculation Issue with Subtracting a Large Number of Years
- Dominant language
- JavaScript
- Stars
- 48.7k
- Forks
- 2.5k
- PR merge metrics
- No merged PRs in 30d
Description
**Describe the bug**
I've encountered an issue with `dayjs` when subtracting a large number of years from a date. Specifically, when I attempt to subtract 129 years from a date, the resulting date is incorrect.

**Expected behavior**
The date after subtracting 129 years should accurately reflect the original month and day, not resetting to the first day of the month.
**Information**
- Day.js Version v1.11.12
- OS: Mac OS
- Browser Chrome/129.0.0.0
- Time zone: America/Toronto
Contributor guide
Research direction
No files or tests are named. Reproduce the reported subtraction with Day.js v1.11.12 using a date, a 129-year subtraction, and the America/Toronto timezone, then trace the date-calculation implementation and existing tests. Done means the resulting date preserves the original month and day rather than resetting to the first day of the month.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- web-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100