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

isValid is not a function #103

Closed
tm1000 opened this issue Feb 13, 2018 · 2 comments
Closed

isValid is not a function #103

tm1000 opened this issue Feb 13, 2018 · 2 comments

Comments

@tm1000
Copy link

tm1000 commented Feb 13, 2018

moment.duration(123, "minutes").format();
moment-duration-format-2.2.1.js?load_version=v14.0.2.1:733 Uncaught TypeError: this.isValid is not a function
    at vb.durationFormat [as format] (moment-duration-format-2.2.1.js?load_version=v14.0.2.1:733)
    at <anonymous>:1:33

I can't see this function anywhere in the code. Not sure if moment is supposed to supply it?

@jsmreese
Copy link
Owner

Off the top of my head I'd guess that isValid was added in a recent version of moment and you're using an older version.

Updating moment should fix the issue, but I'll do some testing with older moment versions. Not sure if this is the only issue.

@tm1000
Copy link
Author

tm1000 commented Feb 13, 2018

@jsmreese huzzah! Thank you for the quick response. I looked in moment and I saw isValid() before opening this but alas you were 100% right. Upgrading from 2.15 to 2.20 solved this issue

@tm1000 tm1000 closed this as completed Feb 13, 2018
jsmreese pushed a commit that referenced this issue Feb 17, 2018
`moment.duration.fn.isValid` was added sometime after moment version 2.15.
Fixes #103.
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