When testing using jasmine, I am getting this error.
TypeError: moment.tz is not a function
My code that I try to test is
l
Moment should be a function call. So use let myDate = moment().tz(...)
See https://momentjs.com/timezone/docs/ for more details.
EDIT
You should also ensure that you are including the timezone extension to the moment library either through the correct npm install and require (for Node) or the correct script tags (for general browser usage). See the linked documents for the libraries/scripts to include.
SECOND EDIT
Should anyone have scrolled this far on a question with a +120 accepted answer:
The suggestion that moment
was a function and requires brackets refers to the un-edited version of the posted question which had the syntax
let myDate = moment.tz(undefined, vm.timeZone).format('YYYY-MM-DD');