Skip to content

Commit

Permalink
Version 0.5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
timrwood committed Mar 1, 2016
1 parent c4a3e30 commit 58651e6
Show file tree
Hide file tree
Showing 10 changed files with 73 additions and 35 deletions.
38 changes: 27 additions & 11 deletions builds/moment-timezone-with-data-2010-2020.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//! moment-timezone.js
//! version : 0.5.0
//! version : 0.5.1
//! author : Tim Wood
//! license : MIT
//! github.com/moment/moment-timezone
Expand All @@ -24,7 +24,7 @@
return moment;
}

var VERSION = "0.5.0",
var VERSION = "0.5.1",
zones = {},
links = {},
names = {},
Expand Down Expand Up @@ -202,14 +202,17 @@

function OffsetAt(at) {
var timeString = at.toTimeString();
var abbr = timeString.match(/\(.+\)/);
var abbr = timeString.match(/\([a-z ]+\)/i);
if (abbr && abbr[0]) {
// 17:56:31 GMT-0600 (CST)
// 17:56:31 GMT-0600 (Central Standard Time)
abbr = abbr[0].match(/[A-Z]/g).join('');
abbr = abbr[0].match(/[A-Z]/g);
abbr = abbr ? abbr.join('') : undefined;
} else {
// 17:56:31 CST
abbr = timeString.match(/[A-Z]{3,5}/g)[0];
// 17:56:31 GMT+0800 (台北標準時間)
abbr = timeString.match(/[A-Z]{3,5}/g);
abbr = abbr ? abbr[0] : undefined;
}

if (abbr === 'GMT') {
Expand Down Expand Up @@ -318,6 +321,19 @@
}

function rebuildGuess () {

// use Intl API when available and returning valid time zone
try {
var intlName = Intl.DateTimeFormat().resolvedOptions().timeZone;
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),
Expand Down Expand Up @@ -578,7 +594,7 @@
}

loadData({
"version": "2015g",
"version": "2016a",
"zones": [
"Africa/Abidjan|GMT|0|0||48e5",
"Africa/Khartoum|EAT|-30|0||51e5",
Expand Down Expand Up @@ -609,7 +625,6 @@
"America/Cancun|CST CDT EST|60 50 50|010101010102|1C1k0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 Dd0|63e4",
"America/Caracas|VET|4u|0||29e5",
"America/Cayenne|GFT|30|0||58e3",
"America/Cayman|EST EDT|50 40|01010101010|1Qtj0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|58e3",
"America/Chicago|CST CDT|60 50|01010101010101010101010|1BQU0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|92e5",
"America/Chihuahua|MST MDT|70 60|01010101010101010101010|1C1l0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0|81e4",
"America/Phoenix|MST|70|0||42e5",
Expand All @@ -627,14 +642,13 @@
"America/La_Paz|BOT|40|0||19e5",
"America/Lima|PET|50|0||11e6",
"America/Mexico_City|CST CDT|60 50|01010101010101010101010|1C1k0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0|20e6",
"America/Metlakatla|PST|80|0||14e2",
"America/Metlakatla|PST AKST AKDT|80 90 80|012121212121|1PAa0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|14e2",
"America/Miquelon|PMST PMDT|30 20|01010101010101010101010|1BQR0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|61e2",
"America/Montevideo|UYST UYT|20 30|010101010101|1BQQ0 1ld0 14n0 1ld0 14n0 1o10 11z0 1o10 11z0 1o10 11z0|17e5",
"America/Noronha|FNT|20|0||30e2",
"America/North_Dakota/Beulah|MST MDT CST CDT|70 60 60 50|01232323232323232323232|1BQV0 1zb0 Oo0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0",
"America/Paramaribo|SRT|30|0||24e4",
"America/Port-au-Prince|EST EDT|50 40|0101010101010101010|1GI70 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|23e5",
"America/Santa_Isabel|PST PDT|80 70|01010101010101010101010|1C1m0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0 14p0 1lb0 14p0 1nX0 11B0 1nX0 11B0 1nX0 14p0 1lb0 14p0 1lb0|23e3",
"America/Santiago|CLST CLT CLT|30 40 30|010101010102|1C1f0 1fB0 1nX0 G10 1EL0 Op0 1zb0 Rd0 1wn0 Rd0 1wn0|62e5",
"America/Sao_Paulo|BRST BRT|20 30|01010101010101010101010|1BIq0 1zd0 On0 1zd0 Rb0 1zd0 Lz0 1C10 Lz0 1C10 On0 1zd0 On0 1zd0 On0 1zd0 On0 1C10 Lz0 1C10 Lz0 1C10|20e6",
"America/Scoresbysund|EGT EGST|10 0|01010101010101010101010|1BWp0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00|452",
Expand All @@ -661,7 +675,7 @@
"Asia/Bishkek|KGT|-60|0||87e4",
"Asia/Brunei|BNT|-80|0||42e4",
"Asia/Kolkata|IST|-5u|0||15e6",
"Asia/Chita|YAKT YAKST YAKT IRKT|-90 -a0 -a0 -80|01023|1BWh0 1qM0 WM0 8Hz0|33e4",
"Asia/Chita|YAKT YAKST YAKT IRKT|-90 -a0 -a0 -80|010230|1BWh0 1qM0 WM0 8Hz0 3re0|33e4",
"Asia/Choibalsan|CHOT CHOST|-80 -90|0101010101010|1O8G0 1cJ0 1cP0 1cJ0 1cP0 1fx0 1cP0 1cJ0 1cP0 1cJ0 1cP0 1cJ0|38e3",
"Asia/Shanghai|CST|-80|0||23e6",
"Asia/Dhaka|BDT|-60|0||16e6",
Expand Down Expand Up @@ -794,6 +808,7 @@
"Pacific/Norfolk|NFT NFT|-bu -b0|01|1PoCu|25e4",
"Pacific/Noumea|NCT|-b0|0||98e3",
"Pacific/Palau|PWT|-90|0||21e3",
"Pacific/Pitcairn|PST|80|0||56",
"Pacific/Pohnpei|PONT|-b0|0||34e3",
"Pacific/Port_Moresby|PGT|-a0|0||25e4",
"Pacific/Rarotonga|CKT|a0|0||13e3",
Expand Down Expand Up @@ -932,6 +947,7 @@
"America/Havana|Cuba",
"America/Los_Angeles|America/Dawson",
"America/Los_Angeles|America/Ensenada",
"America/Los_Angeles|America/Santa_Isabel",
"America/Los_Angeles|America/Tijuana",
"America/Los_Angeles|America/Vancouver",
"America/Los_Angeles|America/Whitehorse",
Expand All @@ -953,7 +969,6 @@
"America/Manaus|America/Boa_Vista",
"America/Manaus|America/Porto_Velho",
"America/Manaus|Brazil/West",
"America/Metlakatla|Pacific/Pitcairn",
"America/Mexico_City|America/Merida",
"America/Mexico_City|America/Monterrey",
"America/Mexico_City|Mexico/General",
Expand Down Expand Up @@ -983,6 +998,7 @@
"America/New_York|US/Michigan",
"America/Noronha|Brazil/DeNoronha",
"America/Panama|America/Atikokan",
"America/Panama|America/Cayman",
"America/Panama|America/Coral_Harbour",
"America/Panama|America/Jamaica",
"America/Panama|EST",
Expand Down
4 changes: 2 additions & 2 deletions builds/moment-timezone-with-data-2010-2020.min.js

Large diffs are not rendered by default.

Loading

0 comments on commit 58651e6

Please sign in to comment.