diff --git a/README.md b/README.md index c2397ad..6e5dd00 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/doc/classes/_tz_database_.tzdatabase.html b/doc/classes/_tz_database_.tzdatabase.html index 2045cbd..466ecec 100644 --- a/doc/classes/_tz_database_.tzdatabase.html +++ b/doc/classes/_tz_database_.tzdatabase.html @@ -202,7 +202,7 @@
Private _zoneInfoCach
_zoneInfoCache: object
@@ -393,7 +393,7 @@
@@ -426,7 +426,7 @@
@@ -476,7 +476,7 @@
@@ -520,7 +520,7 @@
@@ -558,7 +558,7 @@
@@ -619,7 +619,7 @@
@@ -829,7 +829,7 @@
@@ -858,7 +858,7 @@
@@ -889,7 +889,7 @@
@@ -918,7 +918,7 @@
@@ -946,7 +946,7 @@
@@ -975,7 +975,7 @@
diff --git a/doc/index.html b/doc/index.html
index 6779062..a6250e3 100644
--- a/doc/index.html
+++ b/doc/index.html
@@ -705,6 +705,10 @@ - Upgrade timezone database to 2016a
@@ -1040,9 +1044,9 @@
maxDstSave: number
@@ -112,7 +112,7 @@ maxGmtOff: number
@@ -122,7 +122,7 @@ minDstSave: number
@@ -132,7 +132,7 @@ minGmtOff: number
diff --git a/doc/modules/_tz_database_.html b/doc/modules/_tz_database_.html
index e2a0fcf..a288474 100644
--- a/doc/modules/_tz_database_.html
+++ b/doc/modules/_tz_database_.html
@@ -192,7 +192,7 @@
diff --git a/lib/tz-database.ts b/lib/tz-database.ts
index 1c3a796..a3fddea 100644
--- a/lib/tz-database.ts
+++ b/lib/tz-database.ts
@@ -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;
diff --git a/package.json b/package.json
index 752ad3d..45deba4 100644
--- a/package.json
+++ b/package.json
@@ -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",
diff --git a/test/test-datetime.ts b/test/test-datetime.ts
index 12ee72c..960c39e 100644
--- a/test/test-datetime.ts
+++ b/test/test-datetime.ts
@@ -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");
+ });
+ });
});
getRuleInfos
getTransitionsDstOffsets
getTransitionsTotalOffsets
getZoneInfo
getZoneInfos
letterForRule
parseAtType
parseOnDay
parseOnType
parseOnWeekDay
parseRuleType
parseToType
Does timezonecomplete handle
Current TZ database version:
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)
1.0.0 (2014-06-26)
Contributors
-- Rogier Schouten r.schouten@spiritit.com
- - Daan Wissing d.wissing@spiritit.com
- - Peter Kooijmans p.kooijmans@spiritit.com
+ - Rogier Schouten r.schouten@spiritit.com
+ - Daan Wissing d.wissing@spiritit.com
+ - Peter Kooijmans p.kooijmans@spiritit.com
License
MIT
diff --git a/doc/interfaces/_tz_database_.minmaxinfo.html b/doc/interfaces/_tz_database_.minmaxinfo.html index 5842676..0fa56e6 100644 --- a/doc/interfaces/_tz_database_.minmaxinfo.html +++ b/doc/interfaces/_tz_database_.minmaxinfo.html @@ -102,7 +102,7 @@maxDstSave
maxGmtOff
minDstSave
minGmtOff
validateData