jsmreese / moment-duration-format

Format function plugin for the Moment Duration object.
MIT License
968 stars 120 forks source link

isValid is not a function #103

Closed tm1000 closed 6 years ago

tm1000 commented 6 years ago
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 commented 6 years ago

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 commented 6 years ago

@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