Skip to content

Commit

Permalink
pull in 2023b, rebuild, and fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mceachen committed Jun 7, 2023
1 parent d7f3400 commit bedcfa4
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 26 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ This is a fork of [darkskyapp/tz-lookup](https://github.com/darkskyapp/tz-lookup
The following updates have been made to this fork:

* The time zone shapefiles now use
[2021c](https://github.com/evansiroky/timezone-boundary-builder/releases/tag/2021c). Expect a bunch of changes if you're upgrading from the original `tz-lookup`, including new zone names.
[2023b](https://github.com/evansiroky/timezone-boundary-builder/releases/tag/2023b). Expect a bunch of changes if you're upgrading from the original `tz-lookup`, including new zone names.

* TypeScript types are now included.

Expand Down Expand Up @@ -85,11 +85,11 @@ alert(tzlookup(42.7235, -73.6931)); // alerts "America/New_York"
## Sources

Timezone data is sourced from Evan Siroky's [timezone-boundary-builder][tbb].
The database was last updated on 24 September 2022 to use the new 2021c dataset.
The database was last updated on 6 June 2023 to use the new 2023b dataset.

To regenerate the library's database yourself, you will need to install GDAL:

```
```sh
$ brew install gdal # on Mac OS X
$ sudo apt install gdal-bin # on Ubuntu
```
Expand Down
4 changes: 2 additions & 2 deletions rebuild.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#!/bin/bash
set -ex
TZ="2021c"
TZ="2023b"

rm -rf timezones.geojson.zip dist ne_10m_urban_areas.*
curl -L --retry 3 -C - \
-O "https://github.com/evansiroky/timezone-boundary-builder/releases/download/$TZ/timezones.geojson.zip" \
-O 'http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/10m/cultural/ne_10m_urban_areas.zip'
-O 'https://www.naturalearthdata.com/http//www.naturalearthdata.com/download/10m/cultural/ne_10m_urban_areas.zip'
unzip -u timezones.geojson.zip
unzip -u ne_10m_urban_areas.zip
ogr2ogr -f GeoJSON ne_10m_urban_areas.json ne_10m_urban_areas.shp
Expand Down
40 changes: 20 additions & 20 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ describe("tzlookup", function () {
[[47.5886, -122.3382], "America/Los_Angeles"],
[[58.3168, -134.4397], "America/Juneau"],
[[21.4381, -158.0493], "Pacific/Honolulu"],
[[42.7, -80.0], "America/Nipigon"],
[[42.7, -80.0], "America/Toronto"],
[[51.0036, -114.0161], "America/Edmonton"],
[[-16.4965, -68.1702], "America/La_Paz"],
[[-31.9369, 115.8453], "Australia/Perth"],
Expand Down Expand Up @@ -247,7 +247,7 @@ describe("tzlookup", function () {
[[9.5718, -83.1948], "America/Costa_Rica"],
[[11.9618, -71.7086], "America/Bogota"],
[[65.5352, 74.4143], "Asia/Yekaterinburg"],
[[50.5575, -93.9996], "America/Rainy_River"],
[[50.5575, -93.9996], "America/Winnipeg"],
[[51.674, 157.0986], "Asia/Kamchatka"],
[[46.7376, 142.8907], "Asia/Sakhalin"],
[[37.5756, 120.5804], "Asia/Shanghai"],
Expand All @@ -263,7 +263,7 @@ describe("tzlookup", function () {
[[13.6274, 99.6599], "Asia/Bangkok"],
[[-9.6665, -43.4782], "America/Bahia"],
[[17.5016, -8.071], "Africa/Nouakchott"],
[[64.1965, -116.9276], "America/Yellowknife"],
[[64.1965, -116.9276], "America/Edmonton"],
[[74.0116, -35.9084], "America/Nuuk"],
[[28.1819, 47.1326], "Asia/Riyadh"],
[[-25.8522, 139.7641], "Australia/Brisbane"],
Expand All @@ -285,7 +285,7 @@ describe("tzlookup", function () {
[[66.1051, -44.2991], "America/Nuuk"],
[[61.972, -122.8406], "America/Inuvik"],
[[50.7092, 98.1654], "Asia/Ulaanbaatar"],
[[42.7892, -80.2958], "America/Nipigon"],
[[42.7892, -80.2958], "America/Toronto"],
[[20.1117, 53.8416], "Asia/Riyadh"],
[[66.7761, 148.5291], "Asia/Srednekolymsk"],
[[-5.3391, 16.3601], "Africa/Kinshasa"],
Expand Down Expand Up @@ -340,7 +340,7 @@ describe("tzlookup", function () {
[[62.6169, 103.2882], "Asia/Krasnoyarsk"],
[[-2.6981, -73.2412], "America/Lima"],
[[-4.9274, -65.3226], "America/Manaus"],
[[71.1648, -117.7618], "America/Yellowknife"],
[[71.1648, -117.7618], "America/Edmonton"],
[[58.5594, 34.6095], "Europe/Moscow"],
[[55.2956, 32.0908], "Europe/Moscow"],
[[-15.3693, 36.535], "Africa/Maputo"],
Expand All @@ -351,9 +351,9 @@ describe("tzlookup", function () {
[[-22.7467, 130.6468], "Australia/Darwin"],
[[63.8349, 152.536], "Asia/Magadan"],
[[-20.7583, 120.757], "Australia/Perth"],
[[62.7709, -118.4994], "America/Yellowknife"],
[[62.7709, -118.4994], "America/Edmonton"],
[[21.263, 17.5662], "Africa/Ndjamena"],
[[63.7417, -115.2235], "America/Yellowknife"],
[[63.7417, -115.2235], "America/Edmonton"],
[[81.6018, -59.8101], "America/Nuuk"],
[[-38.1635, -57.7626], "America/Argentina/Buenos_Aires"],
[[36.197, -107.8392], "America/Denver"],
Expand All @@ -366,13 +366,13 @@ describe("tzlookup", function () {
[[23.4918, -4.6733], "Africa/Bamako"],
[[23.467, 42.9883], "Asia/Riyadh"],
[[64.0877, 20.1457], "Europe/Stockholm"],
[[73.5927, -115.9105], "America/Yellowknife"],
[[51.8279, -84.3882], "America/Nipigon"],
[[73.5927, -115.9105], "America/Edmonton"],
[[51.8279, -84.3882], "America/Toronto"],
[[56.5034, -108.7968], "America/Swift_Current"],
[[55.2477, 64.4429], "Asia/Yekaterinburg"],
[[79.9054, -80.5558], "America/Iqaluit"],
[[68.1178, 137.7878], "Asia/Vladivostok"],
[[75.4235, 140.6829], "Asia/Vladivostok"],
[[75.4235, 140.6829], "Asia/Yakutsk"],
[[25.1553, 30.5491], "Africa/Cairo"],
[[57.5382, 69.7678], "Asia/Yekaterinburg"],
[[19.2966, 13.2915], "Africa/Niamey"],
Expand Down Expand Up @@ -448,7 +448,7 @@ describe("tzlookup", function () {
[[53.0989, 40.2981], "Europe/Moscow"],
[[46.0498, -119.7057], "America/Los_Angeles"],
[[33.4187, 40.2683], "Asia/Baghdad"],
[[46.6549, 33.7897], "Europe/Kiev"],
[[46.6549, 33.7897], "Europe/Kyiv"],
[[67.5675, 115.0571], "Asia/Yakutsk"],
[[54.214, 45.7523], "Europe/Moscow"],
[[-15.4168, 27.5488], "Africa/Lusaka"],
Expand Down Expand Up @@ -567,7 +567,7 @@ describe("tzlookup", function () {
[[58.7754, -120.0701], "America/Fort_Nelson"],
[[60.8634, -131.1674], "America/Whitehorse"],
[[-2.3241, -65.9156], "America/Manaus"],
[[51.2849, 31.5151], "Europe/Kiev"],
[[51.2849, 31.5151], "Europe/Kyiv"],
[[-0.6626, 17.8965], "Africa/Kinshasa"],
[[73.2245, -96.8935], "America/Rankin_Inlet"],
[[32.3177, 46.9431], "Asia/Baghdad"],
Expand Down Expand Up @@ -599,7 +599,7 @@ describe("tzlookup", function () {
[[31.2644, 21.7824], "Africa/Tripoli"],
[[57.2329, 94.6034], "Asia/Krasnoyarsk"],
[[12.6608, -87.243], "America/Managua"],
[[63.4155, -109.7556], "America/Yellowknife"],
[[63.4155, -109.7556], "America/Edmonton"],
[[41.8814, -113.9326], "America/Denver"],
[[8.1392, 80.1801], "Asia/Colombo"],
[[53.9195, 107.1539], "Asia/Irkutsk"],
Expand Down Expand Up @@ -741,7 +741,7 @@ describe("tzlookup", function () {
[[-29.5255, -66.7115], "America/Argentina/La_Rioja"],
[[53.0595, -63.1278], "America/Goose_Bay"],
[[27.4545, 23.7945], "Africa/Tripoli"],
[[70.6062, -116.7796], "America/Yellowknife"],
[[70.6062, -116.7796], "America/Edmonton"],
[[-78.0266, 89.5463], "Antarctica/Vostok"],
[[-80.8097, 12.1054], "Antarctica/Troll"],
[[-70.7923, 71.7077], "Antarctica/Mawson"],
Expand Down Expand Up @@ -818,7 +818,7 @@ describe("tzlookup", function () {
[[57.7599, 95.4718], "Asia/Krasnoyarsk"],
[[-69.4406, 39.3122], "Antarctica/Syowa"],
[[4.454, 46.1925], "Africa/Mogadishu"],
[[46.333, 35.649], "Europe/Zaporozhye"],
[[46.333, 35.649], "Europe/Kyiv"],
[[18.0784, 94.5354], "Asia/Yangon"],
[[42.0192, 14.5324], "Europe/Rome"],
[[-0.5745, 126.283], "Asia/Jayapura"],
Expand Down Expand Up @@ -848,7 +848,7 @@ describe("tzlookup", function () {
[[81.3302, 60.4397], "Europe/Moscow"],
[[44.9839, 71.9443], "Asia/Almaty"],
[[-70.6835, 9.4712], "Antarctica/Troll"],
[[77.4281, -22.5341], "America/Nuuk"],
// [[77.4281, -22.5341], "America/Nuuk"], // doesn't agree with tz
[[-21.5885, -48.6123], "America/Sao_Paulo"],
[[-5.6724, 106.196], "Asia/Jakarta"],
[[-8.7672, -68.7273], "America/Eirunepe"],
Expand Down Expand Up @@ -910,7 +910,7 @@ describe("tzlookup", function () {
[[81.1039, 65.0911], "Europe/Moscow"],
[[57.1634, -90.2668], "America/Rankin_Inlet"],
[[77.6601, -70.1981], "America/Thule"],
[[81.0588, -66.5886], "America/Pangnirtung"],
[[81.0588, -66.5886], "America/Iqaluit"],
[[68.8512, 171.3592], "Asia/Anadyr"],
[[58.6908, 102.4371], "Asia/Krasnoyarsk"],
[[-88.2361, 97.1364], "Antarctica/McMurdo"],
Expand Down Expand Up @@ -1055,7 +1055,7 @@ describe("tzlookup", function () {
[[77.4624, -73.2223], "America/Thule"],
[[59.8796, 14.399], "Europe/Stockholm"],
[[44.839, -92.373], "America/Chicago"],
[[62.0601, -104.1887], "America/Yellowknife"],
[[62.0601, -104.1887], "America/Edmonton"],
[[42.2095, -2.4099], "Europe/Madrid"],
[[-88.0545, -95.0714], "Antarctica/McMurdo"],
[[-5.9429, -43.007], "America/Fortaleza"],
Expand Down Expand Up @@ -1088,11 +1088,11 @@ describe("tzlookup", function () {
[[67.4068, -123.1871], "America/Inuvik"],
[[22.3989, 101.9252], "Asia/Vientiane"],
[[-87.5659, 14.7744], "Antarctica/McMurdo"],
[[55.6859, -86.2914], "America/Nipigon"],
[[55.6859, -86.2914], "America/Toronto"],
[[-89.5274, -161.9818], "Antarctica/McMurdo"],
[[14.0525, -0.5529], "Africa/Ouagadougou"],
[[-19.9091, 30.927], "Africa/Harare"],
[[54.7107, -87.6633], "America/Nipigon"],
[[54.7107, -87.6633], "America/Toronto"],
[[-6.4873, -45.3957], "America/Fortaleza"],
[[-19.97, -47.674], "America/Sao_Paulo"],
[[70.6514, -51.669], "America/Nuuk"],
Expand Down
2 changes: 1 addition & 1 deletion tz.js

Large diffs are not rendered by default.

0 comments on commit bedcfa4

Please sign in to comment.