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

intervalToDuration seconds and minutes above 59 #3263

Open
ryancrunchi opened this issue Oct 31, 2022 · 2 comments · May be fixed by #3264
Open

intervalToDuration seconds and minutes above 59 #3263

ryancrunchi opened this issue Oct 31, 2022 · 2 comments · May be fixed by #3264
Labels

Comments

@ryancrunchi
Copy link

Version 2.29.3

https://codesandbox.io/s/date-fns-forked-2hwicl?file=/src/index.js

Expected result:
minutes and seconds are not above 59

Current result:
minutes = 1200
seconds = 144000

@fturmel
Copy link
Member

fturmel commented Oct 31, 2022

Interesting edge case, thanks for reporting! PR incoming.

On the main branch we actually get {months:1, hours:-10} which makes more logical sense. The hotfix #3153 in v2 is breaking this issue even more because of Math.abs().

@rjhilgefort
Copy link

I was seeing this issue too with 2670827 * 1000 as my end time, which is 4 weeks 2 days 21 hours 53 min 47 s. I would see seconds that were in the thousands, same with minutes.

intervalToDuration({ start: 0, end: 2670827 * 1000 })

@fturmel I installed your PR and it fixes whatever was happening, thanks!

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

Successfully merging a pull request may close this issue.

3 participants