question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Duration format result is not as expected

See original GitHub issue

Describe the bug When use duration format for an ISO8601, result it’s not as expected : myDuration = dayjs.duration('PT3M39.096S') myDuration.format("HH:mm:ss") => "NaN:03:39.096" myDuration.format("mm:ss") => "03:39.096" myDuration.format("ss") => "39.096" myDuration.format("SSS") => "undefined"

Expected behavior myDuration.format("HH:mm:ss") => "00:03:39" myDuration.format("mm:ss") => "03:39" myDuration.format("ss") => "39" myDuration.format("SSS") => "096"

Information

  • Day.js Version [1.10.5]
  • OS: [Windows]
  • Browser [chrome 90]

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:5
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
iamkuncommented, Sep 10, 2021

🎉 This issue has been resolved in version 1.10.7 🎉

The release is available on:

Your semantic-release bot 📦🚀

1reaction
cypressiouscommented, Aug 18, 2021

I’ve just hit this problem and I’ve found that calling duration.add(0, 'seconds') on a broken instance of Duration will return an instance where the NaN components will be replaced with 0s.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Format Duration on Y-Axis not as expected - Apple Community
Hi, my graphs work but I find that the format of Duration on Y-Axis not as expected, it is showing as decimals and...
Read more >
How to use format() on a moment.js duration? - Stack Overflow
Show activity on this post. If the duration is > of 86400'' (i.e. 24h), this will not work. It's the same in excel,...
Read more >
DURATION NUMBER FORMAT NO LONGER WORKS!
The first group of values in column A is correctly formatted as durations with the format pattern [h]:mm:ss . The second group of...
Read more >
Duration (Java Platform SE 8 ) - Oracle Help Center
The model is of a directed duration, meaning that the duration may be negative. The duration is measured in "seconds", but these are...
Read more >
Cannot format DAX measure to the expected output
Unfortunately, I cannot change the data type to Date Time, because it is not a calculated column. I already tried to transfer the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found