I'm trying to utilize the moment.js library in my script.js file, specifically to determine time zone eligibility. I've loaded the moment.js and moment-timezone-wth-data.js files per the momentjs.com website.
Moment seems to be working fine. If I run the following code, everything seems to be working:
var testnow = moment().format('MMM DD h:mm A');
However, if I attempt to format via a time zone (see below), I receive the following error: moment(...).tz is not a function.
var newchatdate = moment().tz("America/Los_Angeles").format();
Please sign in to leave a comment.