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

dayjs.duration is not a function #1538

Open
galenguyer opened this issue Jun 17, 2021 · 1 comment
Open

dayjs.duration is not a function #1538

galenguyer opened this issue Jun 17, 2021 · 1 comment

Comments

@galenguyer
Copy link

Describe the bug
After loading dayjs from unpkg.com, I ran the example code from the duration with diff section of the docs. The dayjs() function works fine, however when it gets to creating the duration with dayjs.duration(), I get the error Uncaught TypeError: dayjs.duration is not a function

Expected behavior
I expect a duration object to be created for me to use

Information

  • Day.js Version v1.10.5
  • OS: Arch Linux
  • Browser Firefox 89
@bornova
Copy link

bornova commented Jun 21, 2021

Hi @galenguyer,
You need to use the Duration plugin for that example to work:
https://runkit.com/60d016828f113f001ab466e2/60d01986ca31e6001c2079cb

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