Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Formatting duration object with decimal value #1670

Open
Angusross111 opened this issue Oct 19, 2021 · 1 comment
Open

Formatting duration object with decimal value #1670

Angusross111 opened this issue Oct 19, 2021 · 1 comment

Comments

@Angusross111
Copy link

Angusross111 commented Oct 19, 2021

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.]
@innovaweb-dev
Copy link

Solution here :
#965 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants