iamkun / iamkun/dayjs

Feature request: Formatting duration in multiple time units

Open
#897 10 comments 31 reactions 0 assignees View on GitHub
enhancement
Dominant language
JavaScript
Stars
48.7k
Forks
2.5k
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**
Formatting duration via `.humanize()` could be also achieved with multiple time units. e.g.

```javascript
moment.duration({ s: 100 }).humanize({ s: true }) // '100 seconds'
moment.duration({ s: 100 }).humanize({ m: true }) // '1 minute'
moment.duration({ s: 100 }).humanize({ m: true, s: true }) // '1 minute 40 seconds'
moment.duration({ s: 100 }).humanize({ ms: true }) // '10000 milliseconds'
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.