iamkun / iamkun/dayjs

humanize hours problem

Open
#1,779 0 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

**Describe the bug**
when converting a duration to a humanized version, there is a problem when the duration is less than a day

**Expected behavior**
- when input "PT1H30M"
- Expected: 1h30
- result: 1.5 hours
- Example : https://codesandbox.io/s/dayjs-example-forked-2ppsm?file=/src/index.js:526-533
**Information**
- Day.js Version v1.10.6
- OS: ubuntu
- Browser chrome 97
- Time zone: GMT+2

Contributor guide

Open the contributing guide

Research direction

Start with the linked CodeSandbox reproduction and trace the duration humanization behavior for the input "PT1H30M". Done means the result is "1h30" instead of "1.5 hours" for durations shorter than a day.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
tooling
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.