showing results for - "moment 28 29 tz is not a function"
Gerard
16 May 2017
1If you're using Node.js, you may accidentally be using
2
3const moment = require('moment'); //moment
4
5instead of
6
7const moment = require('moment-timezone'); //moment-timezone
8
9Also, make sure you have installed moment-timezone with
10
11npm install moment-timezone --save
12
13Explanation
14The bug of requiring moment without timezones could occur by installing moment
15with require('moment'), later deciding to npm install moment-timezone, and then
16forgetting to update the require.