Best way you use moment-timezone in a Client Controller?

Justin Abbott
Giga Guru

What's the best way to use moment-timezone in a Client Controller of a Widget?

I'm getting an error that states TypeError: moment(...).tz is not a function, even though I can see moment-timezone being loaded in the browser console.

find_real_file.png

I currently have moment-timezone-with-data-2010-2020-v0.5 listed as a Dependency on my Widget, but it looks like it's getting loaded in from js_includes_sp as well.

1 ACCEPTED SOLUTION

Justin Abbott
Giga Guru

I figured it out. Turns out the widget had another dependency that included moment-timezone as a JS Include. Must've been conflicting with each other.

View solution in original post

1 REPLY 1

Justin Abbott
Giga Guru

I figured it out. Turns out the widget had another dependency that included moment-timezone as a JS Include. Must've been conflicting with each other.