Skip to content

duration humanize ignoring leap years #3170

Description

@zac-robinson

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions