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

[Compatibility] Default duration when no argument is provided #1398

Closed
JesusTheHun opened this issue Mar 3, 2021 · 2 comments
Closed

[Compatibility] Default duration when no argument is provided #1398

JesusTheHun opened this issue Mar 3, 2021 · 2 comments

Comments

@JesusTheHun
Copy link
Contributor

Currently to create a duration object one must pass at least one argument.

dayjs.duration("PT0H") // ok
dayjs.duration() // error

Moment.js supports no argument, so in the spirit to ease the transition for the many, I would love to see that in Day.js.
Of course the default duration is 0.

@iamkun
Copy link
Owner

iamkun commented Mar 6, 2021

nice catch, pr is welcomed

@JesusTheHun
Copy link
Contributor Author

I've pushed a PR.
Please consider pushing a package-lock.json to the repository. I had to use npm install --force otherwise npm refused to proceed because of broken dependencies.

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