Skip to content

Commit

Permalink
v1.27.2: Bugfix for zones that have observed DST but no longer do e.g…
Browse files Browse the repository at this point in the history
…. Asia/Tokyo zone (issue #22)
  • Loading branch information
Rogier Schouten committed Feb 2, 2016
1 parent fb254ab commit 2b00d19
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 24 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -707,6 +707,9 @@ The version of the included IANA time zone database is 2016a.

## Changelog

### 1.27.2 (2016-02-02)
* Bugfix for zones that have observed DST but no longer do e.g. Asia/Tokyo zone (issue #22)

### 1.27.1 (2016-01-29)
* Upgrade timezone database to 2016a

Expand Down
28 changes: 14 additions & 14 deletions doc/classes/_tz_database_.tzdatabase.html
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ <h3><span class="tsd-flag ts-flagPrivate">Private</span> _rule<wbr>Info<wbr>Cach
<div class="tsd-signature tsd-kind-icon">_rule<wbr>Info<wbr>Cache<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">object</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/SpiritIT/timezonecomplete/blob/master/lib/tz-database.ts#L1207">tz-database.ts:1207</a></li>
<li>Defined in <a href="https://github.com/SpiritIT/timezonecomplete/blob/master/lib/tz-database.ts#L1208">tz-database.ts:1208</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand All @@ -225,7 +225,7 @@ <h3><span class="tsd-flag ts-flagPrivate">Private</span> _zone<wbr>Info<wbr>Cach
<div class="tsd-signature tsd-kind-icon">_zone<wbr>Info<wbr>Cache<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">object</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/SpiritIT/timezonecomplete/blob/master/lib/tz-database.ts#L1128">tz-database.ts:1128</a></li>
<li>Defined in <a href="https://github.com/SpiritIT/timezonecomplete/blob/master/lib/tz-database.ts#L1129">tz-database.ts:1129</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -393,7 +393,7 @@ <h3>get<wbr>Rule<wbr>Infos</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/SpiritIT/timezonecomplete/blob/master/lib/tz-database.ts#L1216">tz-database.ts:1216</a></li>
<li>Defined in <a href="https://github.com/SpiritIT/timezonecomplete/blob/master/lib/tz-database.ts#L1217">tz-database.ts:1217</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -426,7 +426,7 @@ <h3>get<wbr>Transitions<wbr>Dst<wbr>Offsets</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/SpiritIT/timezonecomplete/blob/master/lib/tz-database.ts#L983">tz-database.ts:983</a></li>
<li>Defined in <a href="https://github.com/SpiritIT/timezonecomplete/blob/master/lib/tz-database.ts#L984">tz-database.ts:984</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -476,7 +476,7 @@ <h3>get<wbr>Transitions<wbr>Total<wbr>Offsets</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/SpiritIT/timezonecomplete/blob/master/lib/tz-database.ts#L1017">tz-database.ts:1017</a></li>
<li>Defined in <a href="https://github.com/SpiritIT/timezonecomplete/blob/master/lib/tz-database.ts#L1018">tz-database.ts:1018</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -520,7 +520,7 @@ <h3>get<wbr>Zone<wbr>Info</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/SpiritIT/timezonecomplete/blob/master/lib/tz-database.ts#L1110">tz-database.ts:1110</a></li>
<li>Defined in <a href="https://github.com/SpiritIT/timezonecomplete/blob/master/lib/tz-database.ts#L1111">tz-database.ts:1111</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -558,7 +558,7 @@ <h3>get<wbr>Zone<wbr>Infos</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/SpiritIT/timezonecomplete/blob/master/lib/tz-database.ts#L1137">tz-database.ts:1137</a></li>
<li>Defined in <a href="https://github.com/SpiritIT/timezonecomplete/blob/master/lib/tz-database.ts#L1138">tz-database.ts:1138</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -619,7 +619,7 @@ <h3>letter<wbr>For<wbr>Rule</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/SpiritIT/timezonecomplete/blob/master/lib/tz-database.ts#L949">tz-database.ts:949</a></li>
<li>Defined in <a href="https://github.com/SpiritIT/timezonecomplete/blob/master/lib/tz-database.ts#L950">tz-database.ts:950</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -829,7 +829,7 @@ <h3>parse<wbr>AtType</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/SpiritIT/timezonecomplete/blob/master/lib/tz-database.ts#L1364">tz-database.ts:1364</a></li>
<li>Defined in <a href="https://github.com/SpiritIT/timezonecomplete/blob/master/lib/tz-database.ts#L1365">tz-database.ts:1365</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -858,7 +858,7 @@ <h3>parse<wbr>OnDay</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/SpiritIT/timezonecomplete/blob/master/lib/tz-database.ts#L1329">tz-database.ts:1329</a></li>
<li>Defined in <a href="https://github.com/SpiritIT/timezonecomplete/blob/master/lib/tz-database.ts#L1330">tz-database.ts:1330</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -889,7 +889,7 @@ <h3>parse<wbr>OnType</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/SpiritIT/timezonecomplete/blob/master/lib/tz-database.ts#L1313">tz-database.ts:1313</a></li>
<li>Defined in <a href="https://github.com/SpiritIT/timezonecomplete/blob/master/lib/tz-database.ts#L1314">tz-database.ts:1314</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -918,7 +918,7 @@ <h3>parse<wbr>OnWeek<wbr>Day</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/SpiritIT/timezonecomplete/blob/master/lib/tz-database.ts#L1347">tz-database.ts:1347</a></li>
<li>Defined in <a href="https://github.com/SpiritIT/timezonecomplete/blob/master/lib/tz-database.ts#L1348">tz-database.ts:1348</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -946,7 +946,7 @@ <h3>parse<wbr>Rule<wbr>Type</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/SpiritIT/timezonecomplete/blob/master/lib/tz-database.ts#L1279">tz-database.ts:1279</a></li>
<li>Defined in <a href="https://github.com/SpiritIT/timezonecomplete/blob/master/lib/tz-database.ts#L1280">tz-database.ts:1280</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -975,7 +975,7 @@ <h3>parse<wbr>ToType</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/SpiritIT/timezonecomplete/blob/master/lib/tz-database.ts#L1293">tz-database.ts:1293</a></li>
<li>Defined in <a href="https://github.com/SpiritIT/timezonecomplete/blob/master/lib/tz-database.ts#L1294">tz-database.ts:1294</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down
10 changes: 7 additions & 3 deletions doc/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -705,6 +705,10 @@ <h3 id="does-timezonecomplete-handle-leap-seconds-">Does timezonecomplete handle
<h2 id="current-tz-database-version-">Current TZ database version:</h2>
<p>The version of the included IANA time zone database is 2016a.</p>
<h2 id="changelog">Changelog</h2>
<h3 id="1-27-2-2016-02-02-">1.27.2 (2016-02-02)</h3>
<ul>
<li>Bugfix for zones that have observed DST but no longer do e.g. Asia/Tokyo zone (issue #22)</li>
</ul>
<h3 id="1-27-1-2016-01-29-">1.27.1 (2016-01-29)</h3>
<ul>
<li>Upgrade timezone database to 2016a</li>
Expand Down Expand Up @@ -1040,9 +1044,9 @@ <h3 id="1-0-0-2014-06-26-">1.0.0 (2014-06-26)</h3>
</ul>
<h2 id="contributors">Contributors</h2>
<ul>
<li>Rogier Schouten <a href="&#109;&#97;&#105;&#108;&#x74;&#x6f;&#x3a;&#x72;&#x2e;&#115;&#99;&#104;&#111;&#x75;&#x74;&#101;&#110;&#x40;&#x73;&#112;&#x69;&#x72;&#105;&#x74;&#105;&#116;&#46;&#99;&#111;&#109;">&#x72;&#x2e;&#115;&#99;&#104;&#111;&#x75;&#x74;&#101;&#110;&#x40;&#x73;&#112;&#x69;&#x72;&#105;&#x74;&#105;&#116;&#46;&#99;&#111;&#109;</a></li>
<li>Daan Wissing <a href="&#x6d;&#x61;&#105;&#108;&#x74;&#111;&#58;&#100;&#46;&#x77;&#105;&#x73;&#115;&#105;&#x6e;&#103;&#64;&#115;&#112;&#105;&#114;&#x69;&#x74;&#x69;&#116;&#46;&#99;&#111;&#109;">&#100;&#46;&#x77;&#105;&#x73;&#115;&#105;&#x6e;&#103;&#64;&#115;&#112;&#105;&#114;&#x69;&#x74;&#x69;&#116;&#46;&#99;&#111;&#109;</a></li>
<li>Peter Kooijmans <a href="&#109;&#x61;&#105;&#x6c;&#116;&#x6f;&#x3a;&#x70;&#x2e;&#x6b;&#111;&#111;&#105;&#106;&#109;&#x61;&#110;&#x73;&#64;&#115;&#112;&#x69;&#114;&#105;&#x74;&#x69;&#x74;&#x2e;&#x63;&#111;&#109;">&#x70;&#x2e;&#x6b;&#111;&#111;&#105;&#106;&#109;&#x61;&#110;&#x73;&#64;&#115;&#112;&#x69;&#114;&#105;&#x74;&#x69;&#x74;&#x2e;&#x63;&#111;&#109;</a></li>
<li>Rogier Schouten <a href="&#x6d;&#97;&#x69;&#108;&#x74;&#x6f;&#58;&#x72;&#46;&#x73;&#99;&#x68;&#x6f;&#117;&#x74;&#101;&#110;&#64;&#x73;&#112;&#x69;&#x72;&#105;&#x74;&#105;&#116;&#46;&#99;&#111;&#x6d;">&#x72;&#46;&#x73;&#99;&#x68;&#x6f;&#117;&#x74;&#101;&#110;&#64;&#x73;&#112;&#x69;&#x72;&#105;&#x74;&#105;&#116;&#46;&#99;&#111;&#x6d;</a></li>
<li>Daan Wissing <a href="&#109;&#x61;&#105;&#x6c;&#x74;&#x6f;&#x3a;&#100;&#46;&#x77;&#x69;&#115;&#x73;&#x69;&#110;&#103;&#x40;&#x73;&#x70;&#105;&#114;&#105;&#116;&#105;&#116;&#46;&#99;&#x6f;&#109;">&#100;&#46;&#x77;&#x69;&#115;&#x73;&#x69;&#110;&#103;&#x40;&#x73;&#x70;&#105;&#114;&#105;&#116;&#105;&#116;&#46;&#99;&#x6f;&#109;</a></li>
<li>Peter Kooijmans <a href="&#x6d;&#97;&#x69;&#x6c;&#x74;&#x6f;&#58;&#x70;&#x2e;&#107;&#111;&#x6f;&#105;&#x6a;&#x6d;&#x61;&#110;&#115;&#64;&#x73;&#x70;&#x69;&#114;&#105;&#116;&#105;&#x74;&#46;&#x63;&#111;&#x6d;">&#x70;&#x2e;&#107;&#111;&#x6f;&#105;&#x6a;&#x6d;&#x61;&#110;&#115;&#64;&#x73;&#x70;&#x69;&#114;&#105;&#116;&#105;&#x74;&#46;&#x63;&#111;&#x6d;</a></li>
</ul>
<h2 id="license">License</h2>
<p>MIT</p>
Expand Down
8 changes: 4 additions & 4 deletions doc/interfaces/_tz_database_.minmaxinfo.html
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ <h3>max<wbr>Dst<wbr>Save</h3>
<div class="tsd-signature tsd-kind-icon">max<wbr>Dst<wbr>Save<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/SpiritIT/timezonecomplete/blob/master/lib/tz-database.ts#L1386">tz-database.ts:1386</a></li>
<li>Defined in <a href="https://github.com/SpiritIT/timezonecomplete/blob/master/lib/tz-database.ts#L1387">tz-database.ts:1387</a></li>
</ul>
</aside>
</section>
Expand All @@ -112,7 +112,7 @@ <h3>max<wbr>Gmt<wbr>Off</h3>
<div class="tsd-signature tsd-kind-icon">max<wbr>Gmt<wbr>Off<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/SpiritIT/timezonecomplete/blob/master/lib/tz-database.ts#L1388">tz-database.ts:1388</a></li>
<li>Defined in <a href="https://github.com/SpiritIT/timezonecomplete/blob/master/lib/tz-database.ts#L1389">tz-database.ts:1389</a></li>
</ul>
</aside>
</section>
Expand All @@ -122,7 +122,7 @@ <h3>min<wbr>Dst<wbr>Save</h3>
<div class="tsd-signature tsd-kind-icon">min<wbr>Dst<wbr>Save<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/SpiritIT/timezonecomplete/blob/master/lib/tz-database.ts#L1385">tz-database.ts:1385</a></li>
<li>Defined in <a href="https://github.com/SpiritIT/timezonecomplete/blob/master/lib/tz-database.ts#L1386">tz-database.ts:1386</a></li>
</ul>
</aside>
</section>
Expand All @@ -132,7 +132,7 @@ <h3>min<wbr>Gmt<wbr>Off</h3>
<div class="tsd-signature tsd-kind-icon">min<wbr>Gmt<wbr>Off<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/SpiritIT/timezonecomplete/blob/master/lib/tz-database.ts#L1387">tz-database.ts:1387</a></li>
<li>Defined in <a href="https://github.com/SpiritIT/timezonecomplete/blob/master/lib/tz-database.ts#L1388">tz-database.ts:1388</a></li>
</ul>
</aside>
</section>
Expand Down
2 changes: 1 addition & 1 deletion doc/modules/_tz_database_.html
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ <h3>validate<wbr>Data</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/SpiritIT/timezonecomplete/blob/master/lib/tz-database.ts#L1394">tz-database.ts:1394</a></li>
<li>Defined in <a href="https://github.com/SpiritIT/timezonecomplete/blob/master/lib/tz-database.ts#L1395">tz-database.ts:1395</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down
3 changes: 2 additions & 1 deletion lib/tz-database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -932,7 +932,8 @@ export class TzDatabase {

/* istanbul ignore if */
if (!offset) {
throw new Error("No offset found.");
// apparently no longer DST, as e.g. for Asia/Tokyo
offset = Duration.minutes(0);
}

return offset;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "timezonecomplete",
"version": "1.27.1",
"version": "1.27.2",
"description": "DateTime, TimeZone, Duration and Period library aimed at providing a consistent and complete date-time interface, away from the original JavaScript Date class.",
"keywords": [
"Date",
Expand Down
8 changes: 8 additions & 0 deletions test/test-datetime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1635,6 +1635,14 @@ describe("DateTime", (): void => {
expect(datetimeFuncs.UTC_MILLIS_CACHE.size()).to.be.lessThan(datetimeFuncs.UTC_MILLIS_CACHE.MAX_CACHE_SIZE + 1);
});
});

describe("issue #22", (): void => {
it("should not crash", (): void => {
var arrivalTime = new DateTime(2016, 2, 12, 11, 0, 0, 0, TimeZone.zone("Asia/Tokyo"));
arrivalTime = arrivalTime.add(Duration.days(1));
expect(arrivalTime.toString()).to.equal("2016-02-13T11:00:00.000 Asia/Tokyo");
});
});
});


Expand Down

0 comments on commit 2b00d19

Please sign in to comment.