duration humanize ignoring leap years
Author: zac-robinsonCreated Aug 6, 2026Updated Aug 6, 2026
Describe the bug
I called dayjs.duration("P9999Y").humanize() and was returned 9992 years
If I call dayjs.duration("P9999Y").asYears() then I get 9999.
Expected behavior
Expected that on large durations then humanize returns the same number of years as .asYears().
Information
- Day.js Version: v1.11.21
- OS: Mac OS
- Browser: Brave v1.93.132
- Time zone: BST
Source: iamkun/dayjs