What are the steps to prepare and use moment-timezone.js with a subset of zones and years

Viewed 1618

After installing moments-timezone with bower:

I see there are packed and unpacked versions of latest timezone data.

In moment-timezone.js I see there is a place holder // INJECT DATA where I presume I'm supposed to insert the packed version of the data I'm interested in.

I see I have the moment-timezone-utils.js with methods to pack/unpack/filter data.

Am I supposed to use all this in order to offline prepare my required version of the data, and than insert the output result instead of the // INJECT DATA place holder?

Update:

Since the "Data" section in Moment home page is currently "Coming soon..." What I currently did is manually running offline:

JSON.stringify(moment.tz.filterLinkPack(unpackedBundle, startYear, endYear));

I took the unpackedBundle json object from the \data\unpacked folder.

And then loaded the result into moment-timezone in my java script code.

moment.tz.load(filteredLinkedPackedBundle);
1 Answers
Related