You need to download all of the following:
- moment
- time zone
- time zone data for an instant-time
- angular -moment
On the tz database home page for the version mentioned on the website.
moment-timezone-with-data-2012-2022.js contains the same tz data, but is truncated only from 2012 to 2022. This is a much smaller data file and is sufficient for most browser-side applications.
/ li>
There are also miniature versions of each of them.
So, if you get "Moment Timezone has no data for America/New_York" , since America/New_York is a valid TZ database identifier, you simply did not upload data for it. You are probably using moment-timezone.js without adding data to it. Either include time zone data using moment.tz.add , or (in a more appropriate way) switch to one of the files, which already includes all time zone data.
However, do not do both. Time zone data should be downloaded only once, and moment and time scenarios should be downloaded only once. If you use either moment-timezone-with-data.js or moment-timezone-with-data-2012-2022.js , you should not use moment-timezone.js since this script is already included.
source share