iamkun / iamkun/dayjs

[Feature request] Disable rounding in `dayjs.duration().humanize()`

Open
#2,970 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
48.7k
Forks
2.5k
PR merge metrics
No merged PRs in 30d

Description

Hi,

It would be nice to have an option for `{ seconds: 10 }` to output `10 seconds` rather than `a few seconds`, and more importantly, for `{ minutes: 45 }` to output `45 minutes` rather than `an hour`.

Thanks

Contributor guide

Open the contributing guide

Research direction

Start at the dayjs.duration().humanize() entry point and inspect how its current rounding behavior is implemented. Define the option's expected behavior from the examples: 10 seconds should remain “10 seconds” and 45 minutes should remain “45 minutes,” while existing output should remain unchanged when the option is not used.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
api
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
56/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.