Skip to content

Commit

Permalink
Merge pull request #398 from spencermountain/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
spencermountain authored Aug 22, 2023
2 parents 55123b0 + 8d3034e commit 7e6f557
Show file tree
Hide file tree
Showing 12 changed files with 670 additions and 129 deletions.
25 changes: 15 additions & 10 deletions builds/spacetime.cjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* spencermountain/spacetime 7.4.6 Apache 2.0 */
/* spencermountain/spacetime 7.4.7 Apache 2.0 */
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
Expand Down Expand Up @@ -76,7 +76,7 @@
"4.5|n": "2/kabul",
"3|s": "12/syowa,9/antananarivo",
"3|n|04/29:02->10/28:02": "2/gaza,2/hebron",
"3|n|03/26:03->10/29:04": "2/famagusta,2/nicosia,8/athens,8/bucharest,8/helsinki,8/kyiv,8/mariehamn,8/riga,8/sofia,8/tallinn,8/uzhgorod,8/vilnius,8/zaporozhye,8/nicosia,8/kiev",
"3|n|03/26:03->10/29:04": "2/famagusta,2/nicosia,8/athens,8/bucharest,8/helsinki,8/kyiv,8/mariehamn,8/riga,8/sofia,8/tallinn,8/uzhgorod,8/vilnius,8/zaporozhye,8/nicosia,8/kiev,eet",
"3|n|03/26:02->10/29:03": "8/chisinau,8/tiraspol",
"3|n|03/26:00->10/28:24": "2/beirut",
"3|n|03/24:02->10/29:02": "2/jerusalem,2/tel_aviv,israel",
Expand All @@ -85,10 +85,10 @@
"2|s|03/26:02->10/29:02": "12/troll",
"2|s": "0/gaborone,0/harare,0/johannesburg,0/lubumbashi,0/lusaka,0/maputo,0/maseru,0/mbabane",
"2|n|04/28:00->10/26:24": "0/cairo,egypt",
"2|n|03/26:02->10/29:03": "0/ceuta,arctic/longyearbyen,8/amsterdam,8/andorra,8/belgrade,8/berlin,8/bratislava,8/brussels,8/budapest,8/busingen,8/copenhagen,8/gibraltar,8/ljubljana,8/luxembourg,8/madrid,8/malta,8/monaco,8/oslo,8/paris,8/podgorica,8/prague,8/rome,8/san_marino,8/sarajevo,8/skopje,8/stockholm,8/tirane,8/vaduz,8/vatican,8/vienna,8/warsaw,8/zagreb,8/zurich,3/jan_mayen,poland",
"2|n|03/26:02->10/29:03": "0/ceuta,arctic/longyearbyen,8/amsterdam,8/andorra,8/belgrade,8/berlin,8/bratislava,8/brussels,8/budapest,8/busingen,8/copenhagen,8/gibraltar,8/ljubljana,8/luxembourg,8/madrid,8/malta,8/monaco,8/oslo,8/paris,8/podgorica,8/prague,8/rome,8/san_marino,8/sarajevo,8/skopje,8/stockholm,8/tirane,8/vaduz,8/vatican,8/vienna,8/warsaw,8/zagreb,8/zurich,3/jan_mayen,poland,cet,met",
"2|n": "0/blantyre,0/bujumbura,0/khartoum,0/kigali,0/tripoli,8/kaliningrad,libya",
"1|s": "0/brazzaville,0/kinshasa,0/luanda,0/windhoek",
"1|n|03/26:01->10/29:02": "3/canary,3/faroe,3/madeira,8/dublin,8/guernsey,8/isle_of_man,8/jersey,8/lisbon,8/london,3/faeroe,eire,8/belfast,gb-eire,gb,portugal",
"1|n|03/26:01->10/29:02": "3/canary,3/faroe,3/madeira,8/dublin,8/guernsey,8/isle_of_man,8/jersey,8/lisbon,8/london,3/faeroe,eire,8/belfast,gb-eire,gb,portugal,wet",
"1|n|03/19:03->04/23:02": "0/casablanca,0/el_aaiun",
"1|n": "0/algiers,0/bangui,0/douala,0/lagos,0/libreville,0/malabo,0/ndjamena,0/niamey,0/porto-novo,0/tunis",
"14|n": "11/kiritimati",
Expand All @@ -107,20 +107,20 @@
"10|n": "2/ust-nera,2/vladivostok,11/guam,11/saipan,11/chuuk,11/truk,11/yap",
"10.5|s|04/02:01->10/01:02": "4/lord_howe,4/lhi",
"0|n|03/26:00->10/29:01": "1/scoresbysund,3/azores",
"0|n": "0/abidjan,0/accra,0/bamako,0/banjul,0/bissau,0/conakry,0/dakar,0/freetown,0/lome,0/monrovia,0/nouakchott,0/ouagadougou,0/sao_tome,1/danmarkshavn,3/reykjavik,3/st_helena,13/gmt,13/utc,0/timbuktu,13/greenwich,13/uct,13/universal,13/zulu,gmt-0,gmt+0,gmt0,greenwich,iceland,uct,universal,utc,zulu,13/unknown",
"0|n": "0/abidjan,0/accra,0/bamako,0/banjul,0/bissau,0/conakry,0/dakar,0/freetown,0/lome,0/monrovia,0/nouakchott,0/ouagadougou,0/sao_tome,1/danmarkshavn,3/reykjavik,3/st_helena,13/gmt,13/utc,0/timbuktu,13/greenwich,13/uct,13/universal,13/zulu,gmt-0,gmt+0,gmt0,greenwich,iceland,uct,universal,utc,zulu,13/unknown,factory",
"-9|n|03/12:02->11/05:02": "1/adak,1/atka,us/aleutian",
"-9|n": "11/gambier",
"-9.5|n": "11/marquesas",
"-8|n|03/12:02->11/05:02": "1/anchorage,1/juneau,1/metlakatla,1/nome,1/sitka,1/yakutat,us/alaska",
"-8|n": "11/pitcairn",
"-7|n|03/12:02->11/05:02": "1/los_angeles,1/santa_isabel,1/tijuana,1/vancouver,1/ensenada,6/pacific,10/bajanorte,us/pacific-new,us/pacific",
"-7|n": "1/creston,1/dawson,1/dawson_creek,1/fort_nelson,1/hermosillo,1/mazatlan,1/phoenix,1/whitehorse,6/yukon,10/bajasur,us/arizona",
"-7|n": "1/creston,1/dawson,1/dawson_creek,1/fort_nelson,1/hermosillo,1/mazatlan,1/phoenix,1/whitehorse,6/yukon,10/bajasur,us/arizona,mst",
"-6|s|04/01:22->09/02:22": "11/easter,7/easterisland",
"-6|n|03/12:02->11/05:02": "1/boise,1/cambridge_bay,1/denver,1/edmonton,1/inuvik,1/north_dakota,1/ojinaga,1/ciudad_juarez,1/yellowknife,1/shiprock,6/mountain,navajo,us/mountain",
"-6|n": "1/bahia_banderas,1/belize,1/chihuahua,1/costa_rica,1/el_salvador,1/guatemala,1/managua,1/merida,1/mexico_city,1/monterrey,1/regina,1/swift_current,1/tegucigalpa,11/galapagos,6/east-saskatchewan,6/saskatchewan,10/general",
"-5|s": "1/lima,1/rio_branco,1/porto_acre,5/acre",
"-5|n|03/12:02->11/05:02": "1/chicago,1/matamoros,1/menominee,1/rainy_river,1/rankin_inlet,1/resolute,1/winnipeg,1/indiana/knox,1/indiana/tell_city,1/north_dakota/beulah,1/north_dakota/center,1/north_dakota/new_salem,1/knox_in,6/central,us/central,us/indiana-starke",
"-5|n": "1/bogota,1/cancun,1/cayman,1/coral_harbour,1/eirunepe,1/guayaquil,1/jamaica,1/panama,1/atikokan,jamaica",
"-5|n": "1/bogota,1/cancun,1/cayman,1/coral_harbour,1/eirunepe,1/guayaquil,1/jamaica,1/panama,1/atikokan,jamaica,est",
"-4|s|04/01:24->09/03:00": "1/santiago,7/continental",
"-4|s|03/25:24->10/01:00": "1/asuncion",
"-4|s": "1/campo_grande,1/cuiaba,1/la_paz,1/manaus,5/west",
Expand All @@ -136,7 +136,7 @@
"-2.5|n|03/12:02->11/05:02": "1/st_johns,6/newfoundland",
"-1|n": "3/cape_verde",
"-11|n": "11/midway,11/niue,11/pago_pago,11/samoa,us/samoa",
"-10|n": "11/honolulu,11/johnston,11/rarotonga,11/tahiti,us/hawaii"
"-10|n": "11/honolulu,11/johnston,11/rarotonga,11/tahiti,us/hawaii,hst"
};

//prefixes for iana names..
Expand Down Expand Up @@ -274,7 +274,7 @@
};
var parseOffset$3 = parseOffset$2;

const local = guessTz$1();
let local = guessTz$1();

//add all the city names by themselves
const cities = Object.keys(zones).reduce((h, k) => {
Expand All @@ -298,6 +298,11 @@
// try our best to reconcile the timzone to this given string
const lookupTz = (str, zones) => {
if (!str) {
// guard if Intl response is unsupported (#397)
if (!zones.hasOwnProperty(local)) {
console.warn(`Unrecognized IANA id '${local}'. Setting fallback tz to UTC.`);
local = 'utc';
}
return local
}
if (typeof str !== 'string') {
Expand Down Expand Up @@ -4024,7 +4029,7 @@
};
var whereIts$1 = whereIts;

var version = '7.4.6';
var version = '7.4.7';

const main = (input, tz, options) => new Spacetime(input, tz, options);

Expand Down
2 changes: 1 addition & 1 deletion builds/spacetime.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion builds/spacetime.mjs

Large diffs are not rendered by default.

155 changes: 88 additions & 67 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,93 +4,114 @@ This project follows semVer, where:
- **[minor]** is a result change
- **[patch]** is a bugfix

<!--
<!--
### 7.2.0 [Sep 2022]
-->

### 7.4.6 [Aug 2023]
- **[change]** - add new dst for #395
- **[update]** - deps

### 7.4.5 [Jul 2023]
- **[fix]** - typescript node16 issue #393
- **[update]** - moroccan and palestinian dst dates
- **[update]** - africa/cairo is back on DST
- **[update]** - deps

### 7.4.4 [May 2023]
- **[fix]** - .week() results #387
- **[fix]** - .dayTime() results #388

### 7.4.3 [April 2023]
- **[fix]** - support leap-years in setting dayOfYear() #382

### 7.4.2 [Mar 2023]
- **[change]** - Iran off of dst #379
- **[change]** - mexico off of dst #378
- **[change]** - allow chaining of .i18() #372
- **[change]** - typescript update #373

### 7.4.1 [Jan 2023]
- **[update]** - add etc/unknown timezone for #367

### 7.4.0 [Dec 2022]
- **[update]** - 2023 DST changes for mexico
- **[update]** - 2023 DST changes for jordan
- **[update]** - 2023 DST changes for fiji
- **[update]** - missing seconds, quarters methods #360 #359
- **[new]** - {AMPM} uppercase fmt

### 7.3.0 [Dec 2022]
- **[update]** - 2023 DST changes
- **[fix]** - southern hemisphere december season #352
- **[fix]** - Yakutsk timezone

### 7.4.7 [Aug 2023]

- **[fix]** - guard against non-IANA responses in Intl #397
- **[update]** - deps

### 7.4.6 [Aug 2023]

- **[change]** - add new dst for #395
- **[update]** - deps

### 7.4.5 [Jul 2023]

- **[fix]** - typescript node16 issue #393
- **[update]** - moroccan and palestinian dst dates
- **[update]** - africa/cairo is back on DST
- **[update]** - deps

### 7.4.4 [May 2023]

- **[fix]** - .week() results #387
- **[fix]** - .dayTime() results #388

### 7.4.3 [April 2023]

- **[fix]** - support leap-years in setting dayOfYear() #382

### 7.4.2 [Mar 2023]

- **[change]** - Iran off of dst #379
- **[change]** - mexico off of dst #378
- **[change]** - allow chaining of .i18() #372
- **[change]** - typescript update #373

### 7.4.1 [Jan 2023]

- **[update]** - add etc/unknown timezone for #367

### 7.4.0 [Dec 2022]

- **[update]** - 2023 DST changes for mexico
- **[update]** - 2023 DST changes for jordan
- **[update]** - 2023 DST changes for fiji
- **[update]** - missing seconds, quarters methods #360 #359
- **[new]** - {AMPM} uppercase fmt

### 7.3.0 [Dec 2022]

- **[update]** - 2023 DST changes
- **[fix]** - southern hemisphere december season #352
- **[fix]** - Yakutsk timezone

### 7.2.0 [Sep 2022]

- **[update]** - Kiev/Kyiv alias
- **[update]** - chile DST change
- **[fix]** - antarctic dst times
- update dependencies

### 7.1.4 [April 2022]

- **[fix]** - export .cjs format for plugins in es5
- **[fix]** - typescript fix #338
- **[fix]** - typescript fix #336
- update dependencies

### 7.1.3 [April 2022]

- **[fix]** - typescript fixes
- **[change]** - update asia/gaza and asia/hebron dst times
- update dependencies

### 7.1.2 [Feb 2022]

- **[fix]** - for asmara issue #328

### 7.1.1 [Feb 2022]

### 7.2.0 [Sep 2022]
- **[update]** - Kiev/Kyiv alias
- **[update]** - chile DST change
- **[fix]** - antarctic dst times
- update dependencies

### 7.1.4 [April 2022]
- **[fix]** - export .cjs format for plugins in es5
- **[fix]** - typescript fix #338
- **[fix]** - typescript fix #336
- update dependencies

### 7.1.3 [April 2022]
- **[fix]** - typescript fixes
- **[change]** - update asia/gaza and asia/hebron dst times
- update dependencies

### 7.1.2 [Feb 2022]
- **[fix]** - for asmara issue #328

### 7.1.1 [Feb 2022]
- **[new]** - support custom i18n strings for am/pm
- **[new]** - more alias support for deprecated iana codes
- **[fix]** - for silent/verbose mode
- update deps

### 7.1.0 [Jan 2022]
- **[change]** - rename cjs build to .cjs [#319](https://github.com/spencermountain/spacetime/issues/319)
### 7.1.0 [Jan 2022]

- **[change]** - rename cjs build to .cjs [#319](https://github.com/spencermountain/spacetime/issues/319)

### 7.0.2 [Jan 2022]

### 7.0.2 [Jan 2022]
- **[fix]** - another esm build path #316

### 7.0.1 [Jan 2022]
### 7.0.1 [Jan 2022]

- **[fix]** - esm build path

### 7.0.0 [Jan 2022]
### 7.0.0 [Jan 2022]

- **[change]** - update to 2022 DST dates
- **[change]** - return 'Sep' instead of 'Sept' in format('month-short') and 'MMM' #304
- **[change]** - convert to ES-modules, + exports fields
- **[change]** - make .every() results inclusive of start
- **[change]** - alias old IANA codes to contemporary ones
- **[change]** - move cal plugin to repo spencermountain/scal
- **[new]** - add ISO duration to .since() results (thanks Adam)
- **[new]** - add ISO duration to .since() results (thanks Adam)
- **[fix]** - iso-parsing issues #320
- **[fix]** - typescript issue #305
- **[fix]** - subtract months issue #312
Expand All @@ -99,8 +120,8 @@ This project follows semVer, where:
- **[change]** - update deps
- bump + republish plugins


### v6.16.4 [Nov 2021]

- **[fix]** - ISO fmt parsing #310
- **[update]** - gaza, hebron dst date change
- update deps
Expand Down
18 changes: 9 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "spacetime",
"version": "7.4.6",
"version": "7.4.7",
"description": "figure-out dates across timezones",
"main": "src/index.js",
"unpkg": "builds/spacetime.min.js",
Expand Down Expand Up @@ -50,7 +50,7 @@
"amble": "^1.3.0",
"codecov": "3.8.3",
"nyc": "^15.1.0",
"rollup": "3.27.0",
"rollup": "3.28.1",
"rollup-plugin-commonjs": "10.1.0",
"rollup-plugin-filesize-check": "0.0.2",
"rollup-plugin-json": "^4.0.0",
Expand All @@ -62,4 +62,4 @@
"timekeeper": "2.3.1"
},
"license": "Apache-2.0"
}
}
4 changes: 2 additions & 2 deletions scratch.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ let s = spacetime()
// console.log(s.dayTime());
console.log(s.json())

let s = spacetime('03/31/2002', 'America/Denver')
console.log(s.iso())
// let s = spacetime('03/31/2002', 'America/Denver')
// console.log(s.iso())
2 changes: 1 addition & 1 deletion src/_version.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export default '7.4.6'
export default '7.4.7'
8 changes: 7 additions & 1 deletion src/timezone/find.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import tzs from '../../zonefile/unpack.js'
import guessTz from './guessTz.js'
import parseOffset from './parseOffset.js'
const local = guessTz()

let local = guessTz()

//add all the city names by themselves
const cities = Object.keys(tzs).reduce((h, k) => {
Expand All @@ -25,6 +26,11 @@ const normalize = (tz) => {
// try our best to reconcile the timzone to this given string
const lookupTz = (str, zones) => {
if (!str) {
// guard if Intl response is unsupported (#397)
if (!zones.hasOwnProperty(local)) {
console.warn(`Unrecognized IANA id '${local}'. Setting fallback tz to UTC.`)
local = 'utc'
}
return local
}
if (typeof str !== 'string') {
Expand Down
Loading

0 comments on commit 7e6f557

Please sign in to comment.