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

Duration format result for SSS #1665

Open
awenger63 opened this issue Oct 14, 2021 · 1 comment
Open

Duration format result for SSS #1665

awenger63 opened this issue Oct 14, 2021 · 1 comment

Comments

@awenger63
Copy link

awenger63 commented Oct 14, 2021

Describe the bug (see #1521 all issues aren't close !)
When use duration format for an ISO8601, result it's not as expected :
myDuration = dayjs.duration('PT3M39.096S')
myDuration.format("SSS") => "undefined"

Expected behavior
myDuration.format("SSS") => "096"

Information

  • Day.js Version [1.10.7]
  • OS: [Windows]
  • Browser [all]
@adroste
Copy link

adroste commented Dec 27, 2021

Same here. Dayjs is not able to parse the floating point format correctly. "39.096S" results in seconds: 39.096 but it should be seconds: 39, milliseconds: 96. @iamkun

Follow-up: As stated here #1521 (comment)

dayjs.duration('PT3M39.096S').add(0, 'seconds').format('HH:mm:ss')

is a workaround at the moment and fixes the broken instance.

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