Skip to content

Commit

Permalink
Build moment-timezone 0.5.44
Browse files Browse the repository at this point in the history
  • Loading branch information
gilmoreorless committed Dec 29, 2023
1 parent 4734cb2 commit 25f19b6
Show file tree
Hide file tree
Showing 9 changed files with 230 additions and 98 deletions.
77 changes: 55 additions & 22 deletions builds/moment-timezone-with-data-10-year-range.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//! moment-timezone.js
//! version : 0.5.43
//! version : 0.5.44
//! Copyright (c) JS Foundation and other contributors
//! license : MIT
//! github.com/moment/moment-timezone
Expand Down Expand Up @@ -29,7 +29,7 @@
// return moment;
// }

var VERSION = "0.5.43",
var VERSION = "0.5.44",
zones = {},
links = {},
countries = {},
Expand Down Expand Up @@ -150,6 +150,30 @@
}
}

function closest (num, arr) {
var len = arr.length;
if (num < arr[0]) {
return 0;
} else if (len > 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] <= num) {
lo = mid;
} else {
hi = mid;
}
}
return hi;
}

Zone.prototype = {
_set : function (unpacked) {
this.name = unpacked.name;
Expand All @@ -164,10 +188,9 @@
untils = this.untils,
i;

for (i = 0; i < untils.length; i++) {
if (target < untils[i]) {
return i;
}
i = closest(target, untils);
if (i >= 0) {
return i;
}
},

Expand Down Expand Up @@ -286,17 +309,21 @@
function userOffsets() {
var startYear = new Date().getFullYear() - 2,
last = new OffsetAt(new Date(startYear, 0, 1)),
lastOffset = last.offset,
offsets = [last],
change, next, i;
change, next, nextOffset, i;

for (i = 1; i < 48; i++) {
next = new OffsetAt(new Date(startYear, i, 1));
if (next.offset !== last.offset) {
nextOffset = new Date(startYear, i, 1).getTimezoneOffset();
if (nextOffset !== lastOffset) {
// Create OffsetAt here to avoid unnecessary abbr parsing before checking offsets
next = new OffsetAt(new Date(startYear, i, 1));
change = findChange(last, next);
offsets.push(change);
offsets.push(new OffsetAt(new Date(change.at + 6e4)));
last = next;
lastOffset = nextOffset;
}
last = next;
}

for (i = 0; i < 4; i++) {
Expand Down Expand Up @@ -334,15 +361,21 @@
var offsetsLength = offsets.length,
filteredGuesses = {},
out = [],
i, j, guessesOffset;
checkedOffsets = {},
i, j, offset, guessesOffset;

for (i = 0; i < offsetsLength; i++) {
guessesOffset = guesses[offsets[i].offset] || {};
offset = offsets[i].offset;
if (checkedOffsets.hasOwnProperty(offset)) {
continue;
}
guessesOffset = guesses[offset] || {};
for (j in guessesOffset) {
if (guessesOffset.hasOwnProperty(j)) {
filteredGuesses[j] = true;
}
}
checkedOffsets[offset] = true;
}

for (i in filteredGuesses) {
Expand Down Expand Up @@ -558,10 +591,10 @@
function tz (input) {
var args = Array.prototype.slice.call(arguments, 0, -1),
name = arguments[arguments.length - 1],
zone = getZone(name),
out = moment.utc.apply(null, args);
out = moment.utc.apply(null, args),
zone;

if (zone && !moment.isMoment(input) && needsOffset(out)) {
if (!moment.isMoment(input) && needsOffset(out) && (zone = getZone(name))) {
out.add(zone.parse(out), 'minutes');
}

Expand Down Expand Up @@ -607,7 +640,7 @@
offset;

if (mom._z === undefined) {
if (zone && needsOffset(mom) && !mom._isUTC) {
if (zone && needsOffset(mom) && !mom._isUTC && mom.isValid()) {
mom._d = moment.utc(mom._a)._d;
mom.utc().add(zone.parse(mom), 'minutes');
}
Expand Down Expand Up @@ -691,7 +724,7 @@
}

loadData({
"version": "2023c",
"version": "2023d",
"zones": [
"Africa/Abidjan|GMT|0|0||48e5",
"Africa/Nairobi|EAT|-30|0||47e5",
Expand Down Expand Up @@ -735,16 +768,17 @@
"America/Ojinaga|MST MDT CST CDT|70 60 60 50|01010101012323232323232|1Vkx0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1wn0 Rc0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0|23e3",
"America/Santiago|-03 -04|30 40|01010101010101010101010|1VJD0 Ap0 1zb0 11B0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 11B0 1qL0 11B0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1nX0 11B0|62e5",
"America/Sao_Paulo|-02 -03|20 30|0101|1Vc20 1HB0 FX0|20e6",
"Atlantic/Azores|-01 +00|10 0|01010101010101010101010|1Vq10 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0|25e4",
"America/Scoresbysund|-01 +00 -02|10 0 20|0101010101010202020202|1Vq10 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 2pA0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0|452",
"America/St_Johns|NST NDT|3u 2u|01010101010101010101010|1Vktu 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0|11e4",
"Antarctica/Casey|+11 +08|-b0 -80|0101010|1Vkh0 1o30 14k0 1kr0 12l0 1o01|10",
"Antarctica/Casey|+11 +08|-b0 -80|010101010101|1Vkh0 1o30 14k0 1kr0 12l0 1o01 14kX 1lf1 14kX 1lf1 13bX|10",
"Asia/Bangkok|+07|-70|0||15e6",
"Asia/Vladivostok|+10|-a0|0||60e4",
"Australia/Sydney|AEDT AEST|-b0 -a0|01010101010101010101010|1VsE0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0|40e5",
"Asia/Tashkent|+05|-50|0||23e5",
"Pacific/Auckland|NZDT NZST|-d0 -c0|01010101010101010101010|1VsC0 1cM0 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1io0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00|14e5",
"Europe/Istanbul|+03|-30|0||13e6",
"Antarctica/Troll|+00 +02|0 -20|01010101010101010101010|1Vq10 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0|40",
"Antarctica/Vostok|+07 +05|-70 -50|01|2bnv0|25",
"Asia/Dhaka|+06|-60|0||16e6",
"Asia/Amman|EET EEST +03|-20 -30 -30|01010101012|1VrW0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 LA0 1C00|25e5",
"Asia/Kamchatka|+12|-c0|0||18e4",
Expand Down Expand Up @@ -774,6 +808,7 @@
"Asia/Seoul|KST|-90|0||23e6",
"Asia/Tehran|+0330 +0430|-3u -4u|01010101010|1VoIu 1dz0 1cp0 1dz0 1cp0 1dz0 1cN0 1dz0 1cp0 1dz0|14e6",
"Asia/Tokyo|JST|-90|0||38e6",
"Atlantic/Azores|-01 +00|10 0|01010101010101010101010|1Vq10 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0|25e4",
"Europe/Lisbon|WET WEST|0 -10|01010101010101010101010|1Vq10 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0|27e5",
"Atlantic/Cape_Verde|-01|10|0||50e4",
"Australia/Adelaide|ACDT ACST|-au -9u|01010101010101010101010|1VsEu 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1fA0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0 1cM0|11e5",
Expand Down Expand Up @@ -1070,7 +1105,6 @@
"Asia/Chita|Asia/Yakutsk",
"Asia/Chita|Etc/GMT-9",
"Asia/Chita|Pacific/Palau",
"Asia/Dhaka|Antarctica/Vostok",
"Asia/Dhaka|Asia/Almaty",
"Asia/Dhaka|Asia/Bishkek",
"Asia/Dhaka|Asia/Dacca",
Expand Down Expand Up @@ -1164,7 +1198,6 @@
"Asia/Vladivostok|Pacific/Port_Moresby",
"Asia/Vladivostok|Pacific/Truk",
"Asia/Vladivostok|Pacific/Yap",
"Atlantic/Azores|America/Scoresbysund",
"Atlantic/Cape_Verde|Etc/GMT+1",
"Australia/Adelaide|Australia/Broken_Hill",
"Australia/Adelaide|Australia/South",
Expand Down Expand Up @@ -1301,7 +1334,7 @@
"AL|Europe/Tirane",
"AM|Asia/Yerevan",
"AO|Africa/Lagos Africa/Luanda",
"AQ|Antarctica/Casey Antarctica/Davis Antarctica/Mawson Antarctica/Palmer Antarctica/Rothera Antarctica/Troll Asia/Urumqi Pacific/Auckland Pacific/Port_Moresby Asia/Riyadh Antarctica/McMurdo Antarctica/DumontDUrville Antarctica/Syowa Antarctica/Vostok",
"AQ|Antarctica/Casey Antarctica/Davis Antarctica/Mawson Antarctica/Palmer Antarctica/Rothera Antarctica/Troll Antarctica/Vostok Pacific/Auckland Pacific/Port_Moresby Asia/Riyadh Antarctica/McMurdo Antarctica/DumontDUrville Antarctica/Syowa",
"AR|America/Argentina/Buenos_Aires America/Argentina/Cordoba America/Argentina/Salta America/Argentina/Jujuy America/Argentina/Tucuman America/Argentina/Catamarca America/Argentina/La_Rioja America/Argentina/San_Juan America/Argentina/Mendoza America/Argentina/San_Luis America/Argentina/Rio_Gallegos America/Argentina/Ushuaia",
"AS|Pacific/Pago_Pago",
"AT|Europe/Vienna",
Expand Down
2 changes: 1 addition & 1 deletion builds/moment-timezone-with-data-10-year-range.min.js

Large diffs are not rendered by default.

Loading

0 comments on commit 25f19b6

Please sign in to comment.