Skip to content

Commit e843cfd

Browse files
Release 0.5.14
1 parent 9d13d65 commit e843cfd

10 files changed

+74
-80
lines changed

builds/moment-timezone-with-data-2012-2022.js

Lines changed: 34 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//! moment-timezone.js
2-
//! version : 0.5.13
2+
//! version : 0.5.14
33
//! Copyright (c) JS Foundation and other contributors
44
//! license : MIT
55
//! github.com/moment/moment-timezone
@@ -24,7 +24,7 @@
2424
// return moment;
2525
// }
2626

27-
var VERSION = "0.5.13",
27+
var VERSION = "0.5.14",
2828
zones = {},
2929
links = {},
3030
names = {},
@@ -192,6 +192,11 @@
192192
},
193193

194194
offset : function (mom) {
195+
logError("zone.offset has been deprecated in favor of zone.utcOffset");
196+
return this.offsets[this._index(mom)];
197+
},
198+
199+
utcOffset : function (mom) {
195200
return this.offsets[this._index(mom)];
196201
}
197202
};
@@ -231,7 +236,7 @@
231236
}
232237

233238
ZoneScore.prototype.scoreOffsetAt = function (offsetAt) {
234-
this.offsetScore += Math.abs(this.zone.offset(offsetAt.at) - offsetAt.offset);
239+
this.offsetScore += Math.abs(this.zone.utcOffset(offsetAt.at) - offsetAt.offset);
235240
if (this.zone.abbr(offsetAt.at).replace(/[^A-Z]/g, '') !== offsetAt.abbr) {
236241
this.abbrScore++;
237242
}
@@ -325,7 +330,7 @@
325330
// use Intl API when available and returning valid time zone
326331
try {
327332
var intlName = Intl.DateTimeFormat().resolvedOptions().timeZone;
328-
if (intlName){
333+
if (intlName && intlName.length > 3) {
329334
var name = names[normalizeName(intlName)];
330335
if (name) {
331336
return name;
@@ -383,9 +388,7 @@
383388
normalized = normalizeName(name);
384389
zones[normalized] = packed[i];
385390
names[normalized] = name;
386-
if (split[5]) {
387-
addToGuesses(normalized, split[2].split(' '));
388-
}
391+
addToGuesses(normalized, split[2].split(' '));
389392
}
390393
}
391394

@@ -464,7 +467,8 @@
464467
}
465468

466469
function needsOffset (m) {
467-
return !!(m._a && (m._tzm === undefined));
470+
var isUnixTimestamp = (m._f === 'X' || m._f === 'x');
471+
return !!(m._a && (m._tzm === undefined) && !isUnixTimestamp);
468472
}
469473

470474
function logError (message) {
@@ -533,7 +537,7 @@
533537
mom._z = zone;
534538
}
535539
if (mom._z) {
536-
offset = mom._z.offset(mom);
540+
offset = mom._z.utcOffset(mom);
537541
if (Math.abs(offset) < 16) {
538542
offset = offset / 60;
539543
}
@@ -545,11 +549,11 @@
545549
}
546550
};
547551

548-
fn.tz = function (name) {
552+
fn.tz = function (name, keepTime) {
549553
if (name) {
550554
this._z = getZone(name);
551555
if (this._z) {
552-
moment.updateOffset(this);
556+
moment.updateOffset(this, keepTime);
553557
} else {
554558
logError("Moment Timezone has no data for " + name + ". See http://momentjs.com/timezone/docs/#/data-loading/.");
555559
}
@@ -596,19 +600,20 @@
596600
}
597601

598602
loadData({
599-
"version": "2017b",
603+
"version": "2017c",
600604
"zones": [
601605
"Africa/Abidjan|GMT|0|0||48e5",
602-
"Africa/Khartoum|EAT|-30|0||51e5",
606+
"Africa/Nairobi|EAT|-30|0||47e5",
603607
"Africa/Algiers|CET|-10|0||26e5",
604608
"Africa/Lagos|WAT|-10|0||17e6",
605609
"Africa/Maputo|CAT|-20|0||26e5",
606610
"Africa/Cairo|EET EEST|-20 -30|01010|1M2m0 gL0 e10 mn0|15e6",
607611
"Africa/Casablanca|WET WEST|0 -10|0101010101010101010101010101010101010101010|1H3C0 wM0 co0 go0 1o00 s00 dA0 vc0 11A0 A00 e00 y00 11A0 uM0 e00 Dc0 11A0 s00 e00 IM0 WM0 mo0 gM0 LA0 WM0 jA0 e00 Rc0 11A0 e00 e00 U00 11A0 8o0 e00 11A0 11A0 5A0 e00 17c0 1fA0 1a00|32e5",
608612
"Europe/Paris|CET CEST|-10 -20|01010101010101010101010|1GNB0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0|11e6",
609613
"Africa/Johannesburg|SAST|-20|0||84e5",
614+
"Africa/Khartoum|EAT CAT|-30 -20|01|1Usl0|51e5",
610615
"Africa/Tripoli|EET CET CEST|-20 -10 -20|0120|1IlA0 TA0 1o00|11e5",
611-
"Africa/Windhoek|WAST WAT|-20 -10|01010101010101010101010|1GQo0 11B0 1qL0 WN0 1qL0 11B0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1qL0 WN0 1qL0 11B0 1nX0 11B0 1nX0 11B0|32e4",
616+
"Africa/Windhoek|WAST WAT CAT|-20 -10 -20|0101010101012|1GQo0 11B0 1qL0 WN0 1qL0 11B0 1nX0 11B0 1nX0 11B0 1nX0 11B0|32e4",
612617
"America/Adak|HST HDT|a0 90|01010101010101010101010|1GIc0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0|326",
613618
"America/Anchorage|AKST AKDT|90 80|01010101010101010101010|1GIb0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0|30e4",
614619
"America/Santo_Domingo|AST|40|0||29e5",
@@ -634,7 +639,7 @@
634639
"America/Fort_Nelson|PST PDT MST|80 70 70|01010102|1GIa0 1zb0 Op0 1zb0 Op0 1zb0 Op0|39e2",
635640
"America/Halifax|AST ADT|40 30|01010101010101010101010|1GI60 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0|39e4",
636641
"America/Godthab|-03 -02|30 20|01010101010101010101010|1GNB0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0|17e3",
637-
"America/Grand_Turk|EST EDT AST|50 40 40|010101012|1GI70 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|37e2",
642+
"America/Grand_Turk|EST EDT AST|50 40 40|0101010121010101010|1GI70 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 5Ip0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0|37e2",
638643
"America/Havana|CST CDT|50 40|01010101010101010101010|1GQt0 1qM0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Rc0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Oo0 1zc0 Rc0 1zc0 Oo0 1zc0|21e5",
639644
"America/Metlakatla|PST AKST AKDT|80 90 80|0121212121212121|1PAa0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0|14e2",
640645
"America/Miquelon|-03 -02|30 20|01010101010101010101010|1GI50 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0|61e2",
@@ -670,7 +675,7 @@
670675
"Asia/Damascus|EET EEST|-20 -30|01010101010101010101010|1GPy0 1nX0 11B0 1nX0 11B0 1qL0 WN0 1qL0 WN0 1qL0 11B0 1nX0 11B0 1nX0 11B0 1nX0 11B0 1qL0 WN0 1qL0 WN0 1qL0|26e5",
671676
"Asia/Dili|+09|-90|0||19e4",
672677
"Asia/Dubai|+04|-40|0||39e5",
673-
"Asia/Famagusta|EET EEST +03|-20 -30 -30|01010101012|1GNB0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 15U0",
678+
"Asia/Famagusta|EET EEST +03|-20 -30 -30|0101010101201010101010|1GNB0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 15U0 2Ks0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0",
674679
"Asia/Gaza|EET EEST|-20 -30|01010101010101010101010|1GPy0 1a00 1fA0 1cL0 1cN0 1nX0 1210 1nz0 1220 1qL0 WN0 1qL0 11B0 1nX0 11B0 1nX0 11B0 1qL0 WN0 1qL0 WN0 1qL0|18e5",
675680
"Asia/Hong_Kong|HKT|-80|0||73e5",
676681
"Asia/Hovd|+07 +08|-70 -80|01010|1O8H0 1cJ0 1cP0 1cJ0|81e3",
@@ -736,12 +741,12 @@
736741
"Pacific/Chatham|+1345 +1245|-dJ -cJ|01010101010101010101010|1GQe0 1cM0 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1cM0 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00|600",
737742
"Pacific/Apia|+14 +13|-e0 -d0|01010101010101010101010|1GQe0 1cM0 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1cM0 1fA0 1a00 1fA0 1a00 1fA0 1a00 1fA0 1a00|37e3",
738743
"Pacific/Bougainville|+10 +11|-a0 -b0|01|1NwE0|18e4",
739-
"Pacific/Fiji|+13 +12|-d0 -c0|01010101010101010101010|1Goe0 1Nc0 Ao0 1Q00 xz0 1SN0 uM0 1SM0 uM0 1VA0 s00 1VA0 uM0 1SM0 uM0 1SM0 uM0 1SM0 uM0 1VA0 s00 1VA0|88e4",
744+
"Pacific/Fiji|+13 +12|-d0 -c0|01010101010101010101010|1Goe0 1Nc0 Ao0 1Q00 xz0 1SN0 uM0 1SM0 uM0 1VA0 s00 1VA0 s00 1VA0 uM0 1SM0 uM0 1SM0 uM0 1VA0 s00 1VA0|88e4",
740745
"Pacific/Guam|ChST|-a0|0||17e4",
741746
"Pacific/Marquesas|-0930|9u|0||86e2",
742747
"Pacific/Pago_Pago|SST|b0|0||37e2",
743748
"Pacific/Norfolk|+1130 +11|-bu -b0|01|1PoCu|25e4",
744-
"Pacific/Tongatapu|+13 +14|-d0 -e0|01010101010101|1S4d0 s00 1VA0 uM0 1SM0 uM0 1SM0 uM0 1SM0 uM0 1VA0 s00 1VA0|75e3"
749+
"Pacific/Tongatapu|+13 +14|-d0 -e0|010|1S4d0 s00|75e3"
745750
],
746751
"links": [
747752
"Africa/Abidjan|Africa/Accra",
@@ -776,18 +781,6 @@
776781
"Africa/Casablanca|Africa/El_Aaiun",
777782
"Africa/Johannesburg|Africa/Maseru",
778783
"Africa/Johannesburg|Africa/Mbabane",
779-
"Africa/Khartoum|Africa/Addis_Ababa",
780-
"Africa/Khartoum|Africa/Asmara",
781-
"Africa/Khartoum|Africa/Asmera",
782-
"Africa/Khartoum|Africa/Dar_es_Salaam",
783-
"Africa/Khartoum|Africa/Djibouti",
784-
"Africa/Khartoum|Africa/Juba",
785-
"Africa/Khartoum|Africa/Kampala",
786-
"Africa/Khartoum|Africa/Mogadishu",
787-
"Africa/Khartoum|Africa/Nairobi",
788-
"Africa/Khartoum|Indian/Antananarivo",
789-
"Africa/Khartoum|Indian/Comoro",
790-
"Africa/Khartoum|Indian/Mayotte",
791784
"Africa/Lagos|Africa/Bangui",
792785
"Africa/Lagos|Africa/Brazzaville",
793786
"Africa/Lagos|Africa/Douala",
@@ -805,6 +798,17 @@
805798
"Africa/Maputo|Africa/Kigali",
806799
"Africa/Maputo|Africa/Lubumbashi",
807800
"Africa/Maputo|Africa/Lusaka",
801+
"Africa/Nairobi|Africa/Addis_Ababa",
802+
"Africa/Nairobi|Africa/Asmara",
803+
"Africa/Nairobi|Africa/Asmera",
804+
"Africa/Nairobi|Africa/Dar_es_Salaam",
805+
"Africa/Nairobi|Africa/Djibouti",
806+
"Africa/Nairobi|Africa/Juba",
807+
"Africa/Nairobi|Africa/Kampala",
808+
"Africa/Nairobi|Africa/Mogadishu",
809+
"Africa/Nairobi|Indian/Antananarivo",
810+
"Africa/Nairobi|Indian/Comoro",
811+
"Africa/Nairobi|Indian/Mayotte",
808812
"Africa/Tripoli|Libya",
809813
"America/Adak|America/Atka",
810814
"America/Adak|US/Aleutian",
@@ -906,7 +910,6 @@
906910
"America/Managua|America/Regina",
907911
"America/Managua|America/Swift_Current",
908912
"America/Managua|America/Tegucigalpa",
909-
"America/Managua|Canada/East-Saskatchewan",
910913
"America/Managua|Canada/Saskatchewan",
911914
"America/Mexico_City|America/Bahia_Banderas",
912915
"America/Mexico_City|America/Merida",

builds/moment-timezone-with-data-2012-2022.min.js

Lines changed: 1 addition & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)