//! moment-timezone.js //! version : 0.6.0 //! Copyright (c) JS Foundation and other contributors //! license : MIT //! github.com/moment/moment-timezone (function (root, factory) { "use strict"; /*global define*/ if (typeof module === 'object' && module.exports) { module.exports = factory(require('moment')); // Node } else if (typeof define === 'function' && define.amd) { define(['moment'], factory); // AMD } else { factory(root.moment); // Browser } }(this, function (moment) { "use strict"; // Resolves es6 module loading issue if (moment.version === undefined && moment.default) { moment = moment.default; } // Do not load moment-timezone a second time. // if (moment.tz !== undefined) { // logError('Moment Timezone ' + moment.tz.version + ' was already loaded ' + (moment.tz.dataVersion ? 'with data from ' : 'without any data') + moment.tz.dataVersion); // return moment; // } var VERSION = "0.6.0", zones = {}, links = {}, countries = {}, names = {}, guesses = {}, cachedGuess; if (!moment || typeof moment.version !== 'string') { logError('Moment Timezone requires Moment.js. See https://momentjs.com/timezone/docs/#/use-it/browser/'); } var momentVersion = moment.version.split('.'), major = +momentVersion[0], minor = +momentVersion[1]; // Moment.js version check if (major = 2.6.0. You are using Moment.js ' + moment.version + '. See momentjs.com'); } /************************************ Unpacking ************************************/ function charCodeToInt(charCode) { if (charCode > 96) { return charCode - 87; } else if (charCode > 64) { return charCode - 29; } return charCode - 48; } function unpackBase60(string) { var i = 0, parts = string.split('.'), whole = parts[0], fractional = parts[1] || '', multiplier = 1, num, out = 0, sign = 1; // handle negative numbers if (string.charCodeAt(0) === 45) { i = 1; sign = -1; } // handle digits before the decimal for (i; i 1 && arr[len - 1] === Infinity && num >= arr[len - 2]) { return len - 1; } else if (num >= arr[len - 1]) { return -1; } var mid; var lo = 0; var hi = len - 1; while (hi - lo > 1) { mid = Math.floor((lo + hi) / 2); if (arr[mid] = 0) { return i; } }, countries : function () { var zone_name = this.name; return Object.keys(countries).filter(function (country_code) { return countries[country_code].zones.indexOf(zone_name) !== -1; }); }, parse : function (timestamp) { var target = +timestamp, offsets = this.offsets, untils = this.untils, max = untils.length - 1, offset, offsetNext, offsetPrev, i; for (i = 0; i offsetPrev && tz.moveInvalidForward) { offset = offsetPrev; } if (target 3) { var name = names[normalizeName(intlName)]; if (name) { return name; } logError("Moment Timezone found " + intlName + " from the Intl api, but did not have that data loaded."); } } catch (e) { // Intl unavailable, fall back to manual guessing. } var offsets = userOffsets(), offsetsLength = offsets.length, guesses = guessesForUserOffsets(offsets), zoneScores = [], zoneScore, i, j; for (i = 0; i 0 ? zoneScores[0].zone.name : undefined; } function guess (ignoreCache) { if (!cachedGuess || ignoreCache) { cachedGuess = rebuildGuess(); } return cachedGuess; } /************************************ Global Methods ************************************/ function normalizeName (name) { return (name || '').toLowerCase().replace(/\//g, '_'); } function addZone (packed) { var i, name, split, normalized; if (typeof packed === "string") { packed = [packed]; } for (i = 0; i 0) this._z = null; return old.apply(this, arguments); }; } fn.zoneName = abbrWrap(fn.zoneName); fn.zoneAbbr = abbrWrap(fn.zoneAbbr); fn.utc = resetZoneWrap(fn.utc); fn.local = resetZoneWrap(fn.local); fn.utcOffset = resetZoneWrap2(fn.utcOffset); moment.tz.setDefault = function(name) { if (major = 2.9.0. You are using Moment.js ' + moment.version + '.'); } moment.defaultZone = name ? getZone(name) : null; return moment; }; // Cloning a moment should include the _z property. var momentProperties = moment.momentProperties; if (Object.prototype.toString.call(momentProperties) === '[object Array]') { // moment 2.8.1+ momentProperties.push('_z'); momentProperties.push('_a'); } else if (momentProperties) { // moment 2.7.0 momentProperties._z = null; } // INJECT DATA return moment; }));