You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
web/files/moment-timezone-with-data.m...

1 line
180 KiB
JavaScript

2 weeks ago
!function(c,M){"use strict";"function"==typeof define&&define.amd?define(["moment"],M):"object"==typeof module&&module.exports?module.exports=M(require("moment")):M(c.moment)}(this,function(c){"use strict";function M(c){return c>96?c-87:c>64?c-29:c-48}function z(c){var z=0,A=c.split("."),b=A[0],o=A[1]||"",p=1,n=0,a=1;for(45===c.charCodeAt(0)&&(z=1,a=-1),z;z<b.length;z++)n=60*n+M(b.charCodeAt(z));for(z=0;z<o.length;z++)p/=60,n+=M(o.charCodeAt(z))*p;return n*a}function A(c){for(var M=0;M<c.length;M++)c[M]=z(c[M])}function b(c,M){for(var z=0;z<M;z++)c[z]=Math.round((c[z-1]||0)+6e4*c[z]);c[M-1]=1/0}function o(c,M){var z,A=[];for(z=0;z<M.length;z++)A[z]=c[M[z]];return A}function p(c){var M=c.split("|"),z=M[2].split(" "),p=M[3].split(""),n=M[4].split(" ");return A(z),A(p),A(n),b(n,p.length),{name:M[0],abbrs:o(M[1].split(" "),p),offsets:o(z,p),untils:n,population:0|M[5]}}function n(c){c&&this._set(p(c))}function a(c){var M=c.toTimeString(),z=M.match(/\([a-z ]+\)/i);"GMT"===(z=z&&z[0]?(z=z[0].match(/[A-Z]/g))?z.join(""):void 0:(z=M.match(/[A-Z]{3,5}/g))?z[0]:void 0)&&(z=void 0),this.at=+c,this.abbr=z,this.offset=c.getTimezoneOffset()}function O(c){this.zone=c,this.offsetScore=0,this.abbrScore=0}function L(c,M){for(var z,A;A=6e4*((M.at-c.at)/12e4|0);)(z=new a(new Date(c.at+A))).offset===c.offset?c=z:M=z;return c}function q(){var c,M,z,A=(new Date).getFullYear()-2,b=new a(new Date(A,0,1)),o=[b];for(z=1;z<48;z++)(M=new a(new Date(A,z,1))).offset!==b.offset&&(c=L(b,M),o.push(c),o.push(new a(new Date(c.at+6e4)))),b=M;for(z=0;z<4;z++)o.push(new a(new Date(A+z,0,1))),o.push(new a(new Date(A+z,6,1)));return o}function N(c,M){return c.offsetScore!==M.offsetScore?c.offsetScore-M.offsetScore:c.abbrScore!==M.abbrScore?c.abbrScore-M.abbrScore:M.zone.population-c.zone.population}function i(c,M){var z,b;for(A(M),z=0;z<M.length;z++)b=M[z],m[b]=m[b]||{},m[b][c]=!0}function W(c){var M,z,A,b=c.length,o={},p=[];for(M=0;M<b;M++){A=m[c[M].offset]||{};for(z in A)A.hasOwnProperty(z)&&(o[z]=!0)}for(M in o)o.hasOwnProperty(M)&&p.push(S[M]);return p}function d(){try{var c=Intl.DateTimeFormat().resolvedOptions().timeZone;if(c&&c.length>3){var M=S[e(c)];if(M)return M;u("Moment Timezone found "+c+" from the Intl api, but did not have that data loaded.")}}catch(c){}var z,A,b,o=q(),p=o.length,n=W(o),a=[];for(A=0;A<n.length;A++){for(z=new O(f(n[A]),p),b=0;b<p;b++)z.scoreOffsetAt(o[b]);a.push(z)}return a.sort(N),a.length>0?a[0].zone.name:void 0}function e(c){return(c||"").toLowerCase().replace(/\//g,"_")}function X(c){var M,z,A,b;for("string"==typeof c&&(c=[c]),M=0;M<c.length;M++)b=e(z=(A=c[M].split("|"))[0]),E[b]=c[M],S[b]=z,i(b,A[2].split(" "))}function f(c,M){c=e(c);var z,A=E[c];return A instanceof n?A:"string"==typeof A?(A=new n(A),E[c]=A,A):R[c]&&M!==f&&(z=f(R[c],f))?((A=E[c]=new n)._set(z),A.name=S[c],A):null}function B(c){var M,z,A,b;for("string"==typeof c&&(c=[c]),M=0;M<c.length;M++)A=e((z=c[M].split("|"))[0]),b=e(z[1]),R[A]=b,S[A]=z[0],R[b]=A,S[b]=z[1]}function r(c){X(c.zones),B(c.links),t.dataVersion=c.version}function T(c){return T.didShowError||(T.didShowError=!0,u("moment.tz.zoneExists('"+c+"') has been deprecated in favor of !moment.tz.zone('"+c+"')")),!!f(c)}function l(c){var M="X"===c._f||"x"===c._f;return!(!c._a||void 0!==c._tzm||M)}function u(c){"undefined"!=typeof console&&"function"==typeof console.error&&console.error(c)}function t(M){var z=Array.prototype.slice.call(arguments,0,-1),A=arguments[arguments.length-1],b=f(A),o=c.utc.apply(null,z);return b&&!c.isMoment(M)&&l(o)&&o.add(b.parse(o),"minutes"),o.tz(A),o}function s(c){return function(){return this._z?this._z.abbr(this):c.call(this)}}var C,E={},R={},S={},m={},D=c.version.split("."),P=+D[0],g=+D[1];(P<2||2===P&&g<6)&&u("Moment Timezone requires Moment.js >= 2.6.0. You are using Moment.js "+c.version+". See momentjs.com"),n.prototype={_set:function(c){this.name=c.name,this.abbrs=c.abbrs,this.untils=c.untils,this.offsets=c.offsets,this.population=c.population},_index:function(c){var M,z=+c,A=this.untils;for(M=0;M<A.length;M++)if(z<A[M])return M},parse:function(c){var M,z,A,b,o=+c,p=this.