dayjs
dayjs copied to clipboard
Formatting duration object with decimal value
Describe the bug Formatting a decimal value doesnt seperate out the hours and minutes
myDuration = dayjs.duration({ hours: 4.8 })
myDuration.format("HH:mm") => 4.8:undefined
Expected behavior
myDuration.format("HH:mm") => 04:48
The $ms is recorded correctly as $ms: 17280000
and the following outputs correctly:
dayjs.duration(17280000).format("HH:mm") => 04:48
Am I expected to break up the duration into respected hours and minutes before passing it to dayjs duration?
Information
- Day.js Version [1.10.7]
- OS: [Ubuntu 20.04]
- Browser [chrome 94.]
Solution here : https://github.com/iamkun/dayjs/issues/965#issuecomment-975474746