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 returns strings instead of numbers #1389

Closed
Emroni opened this issue Feb 20, 2021 · 2 comments · Fixed by #1394
Closed

Duration returns strings instead of numbers #1389

Emroni opened this issue Feb 20, 2021 · 2 comments · Fixed by #1394
Labels
☢️Bug Something isn't working released

Comments

@Emroni
Copy link

Emroni commented Feb 20, 2021

Describe the bug
When parsing a duration string, eg dayjs.duration('P1Y2M3W4DT12H34M56S') and logging the result, it returns the values as strings instead of numbers:

image

Expected behavior
It should return numbers, as given by the return type in plugins/duration.d.ts.

Information

  • Day.js Version 1.10.4
  • OS: OSX 11.2.1
  • Browser: Chrome 88.0.4324.182
  • Time zone: GMT+7
@iamkun
Copy link
Owner

iamkun commented Feb 20, 2021

Yes, it's a bug. Would you like to create a pull request to fix this?

@iamkun
Copy link
Owner

iamkun commented May 26, 2021

🎉 This issue has been resolved in version 1.10.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
☢️Bug Something isn't working released
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants