@js-joda/timezone 2.6.0 → 2.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5 -0
- package/README.md +3 -2
- package/dist/js-joda-timezone-10-year-range.js +276 -196
- package/dist/js-joda-timezone-10-year-range.js.map +1 -1
- package/dist/js-joda-timezone-10-year-range.min.js +1 -1
- package/dist/js-joda-timezone-1970-2030.js +276 -196
- package/dist/js-joda-timezone-1970-2030.js.map +1 -1
- package/dist/js-joda-timezone-1970-2030.min.js +1 -1
- package/dist/js-joda-timezone-2012-2022.js +276 -196
- package/dist/js-joda-timezone-2012-2022.js.map +1 -1
- package/dist/js-joda-timezone-2012-2022.min.js +1 -1
- package/dist/js-joda-timezone-empty.js +276 -196
- package/dist/js-joda-timezone-empty.js.map +1 -1
- package/dist/js-joda-timezone-empty.min.js +1 -1
- package/dist/js-joda-timezone.js +276 -196
- package/dist/js-joda-timezone.js.map +1 -1
- package/dist/js-joda-timezone.min.js +1 -1
- package/package.json +10 -36
- package/src/MomentZoneRules.js +1 -1
- package/src/MomentZoneRulesProvider.js +1 -1
- package/src/auto-plug.js +3 -0
- package/src/plug.js +3 -0
- package/src/system-default-zone.js +12 -2
- package/src/unpack.js +12 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//! @version @js-joda/timezone-2.
|
|
1
|
+
//! @version @js-joda/timezone-2.7.0-2021a-1970-2030
|
|
2
2
|
//! @copyright (c) 2015-present, Philipp Thürwächter, Pattrick Hüper & js-joda contributors
|
|
3
3
|
//! @license BSD-3-Clause (see LICENSE in the root directory of this source tree)
|
|
4
4
|
(function webpackUniversalModuleDefinition(root, factory) {
|
|
@@ -122,7 +122,27 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
122
122
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MomentZoneRules", function() { return MomentZoneRules; });
|
|
123
123
|
/* harmony import */ var _js_joda_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @js-joda/core */ "@js-joda/core");
|
|
124
124
|
/* harmony import */ var _js_joda_core__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__);
|
|
125
|
-
function
|
|
125
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
126
|
+
|
|
127
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
128
|
+
|
|
129
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
130
|
+
|
|
131
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
132
|
+
|
|
133
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
134
|
+
|
|
135
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
136
|
+
|
|
137
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
138
|
+
|
|
139
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
140
|
+
|
|
141
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
142
|
+
|
|
143
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
144
|
+
|
|
145
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
126
146
|
|
|
127
147
|
/*
|
|
128
148
|
* @copyright (c) 2016-present, Philipp Thürwächter, Pattrick Hüper
|
|
@@ -131,188 +151,215 @@ function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.crea
|
|
|
131
151
|
*/
|
|
132
152
|
|
|
133
153
|
var MomentZoneRules = function (_ZoneRules) {
|
|
134
|
-
|
|
154
|
+
_inherits(MomentZoneRules, _ZoneRules);
|
|
155
|
+
|
|
156
|
+
var _super = _createSuper(MomentZoneRules);
|
|
135
157
|
|
|
136
158
|
function MomentZoneRules(tzdbInfo) {
|
|
137
159
|
var _this;
|
|
138
160
|
|
|
139
|
-
|
|
161
|
+
_classCallCheck(this, MomentZoneRules);
|
|
162
|
+
|
|
163
|
+
_this = _super.call(this);
|
|
140
164
|
_this._tzdbInfo = tzdbInfo;
|
|
141
165
|
_this._ldtUntils = new LDTUntils(_this._tzdbInfo.untils, _this._tzdbInfo.offsets);
|
|
142
166
|
return _this;
|
|
143
167
|
}
|
|
144
168
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
};
|
|
150
|
-
|
|
151
|
-
_proto.offsetOfInstant = function offsetOfInstant(instant) {
|
|
152
|
-
var epochMilli = instant.toEpochMilli();
|
|
153
|
-
return this.offsetOfEpochMilli(epochMilli);
|
|
154
|
-
};
|
|
155
|
-
|
|
156
|
-
_proto.offsetOfEpochMilli = function offsetOfEpochMilli(epochMilli) {
|
|
157
|
-
var index = binarySearch(this._tzdbInfo.untils, epochMilli);
|
|
158
|
-
return _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ZoneOffset"].ofTotalSeconds(this._offsetByIndexInSeconds(index));
|
|
159
|
-
};
|
|
160
|
-
|
|
161
|
-
_proto.offsetOfLocalDateTime = function offsetOfLocalDateTime(localDateTime) {
|
|
162
|
-
var info = this._offsetInfo(localDateTime);
|
|
163
|
-
|
|
164
|
-
if (info instanceof _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ZoneOffsetTransition"]) {
|
|
165
|
-
return info.offsetBefore();
|
|
169
|
+
_createClass(MomentZoneRules, [{
|
|
170
|
+
key: "isFixedOffset",
|
|
171
|
+
value: function isFixedOffset() {
|
|
172
|
+
return this._tzdbInfo.offsets.length === 1;
|
|
166
173
|
}
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
var index = ldtBinarySearch(this._ldtUntils, localDateTime);
|
|
173
|
-
var offsetIndex = index >> 1;
|
|
174
|
-
|
|
175
|
-
if (index % 2 === 1) {
|
|
176
|
-
var ldtBefore = this._ldtUntils.get(Math.max(index - 1, 0));
|
|
177
|
-
|
|
178
|
-
var ldtAfter = this._ldtUntils.get(Math.min(index, this._ldtUntils.size - 1));
|
|
179
|
-
|
|
180
|
-
var offsetBefore = _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ZoneOffset"].ofTotalSeconds(this._offsetByIndexInSeconds(offsetIndex));
|
|
181
|
-
var offsetAfter = _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ZoneOffset"].ofTotalSeconds(this._offsetByIndexInSeconds(Math.min(offsetIndex + 1, this._tzdbInfo.offsets.length - 1)));
|
|
182
|
-
|
|
183
|
-
if (offsetBefore.compareTo(offsetAfter) > 0) {
|
|
184
|
-
return _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ZoneOffsetTransition"].of(ldtBefore, offsetBefore, offsetAfter);
|
|
185
|
-
} else {
|
|
186
|
-
return _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ZoneOffsetTransition"].of(ldtAfter, offsetBefore, offsetAfter);
|
|
187
|
-
}
|
|
174
|
+
}, {
|
|
175
|
+
key: "offsetOfInstant",
|
|
176
|
+
value: function offsetOfInstant(instant) {
|
|
177
|
+
var epochMilli = instant.toEpochMilli();
|
|
178
|
+
return this.offsetOfEpochMilli(epochMilli);
|
|
188
179
|
}
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
return -offsetInSeconds(this._tzdbInfo.offsets[index]);
|
|
195
|
-
};
|
|
196
|
-
|
|
197
|
-
_proto.validOffsets = function validOffsets(localDateTime) {
|
|
198
|
-
var info = this._offsetInfo(localDateTime);
|
|
199
|
-
|
|
200
|
-
if (info instanceof _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ZoneOffsetTransition"]) {
|
|
201
|
-
return info.validOffsets();
|
|
180
|
+
}, {
|
|
181
|
+
key: "offsetOfEpochMilli",
|
|
182
|
+
value: function offsetOfEpochMilli(epochMilli) {
|
|
183
|
+
var index = binarySearch(this._tzdbInfo.untils, epochMilli);
|
|
184
|
+
return _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ZoneOffset"].ofTotalSeconds(this._offsetByIndexInSeconds(index));
|
|
202
185
|
}
|
|
186
|
+
}, {
|
|
187
|
+
key: "offsetOfLocalDateTime",
|
|
188
|
+
value: function offsetOfLocalDateTime(localDateTime) {
|
|
189
|
+
var info = this._offsetInfo(localDateTime);
|
|
203
190
|
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
_proto.transition = function transition(localDateTime) {
|
|
208
|
-
var info = this._offsetInfo(localDateTime);
|
|
191
|
+
if (info instanceof _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ZoneOffsetTransition"]) {
|
|
192
|
+
return info.offsetBefore();
|
|
193
|
+
}
|
|
209
194
|
|
|
210
|
-
if (info instanceof _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ZoneOffsetTransition"]) {
|
|
211
195
|
return info;
|
|
212
196
|
}
|
|
197
|
+
}, {
|
|
198
|
+
key: "_offsetInfo",
|
|
199
|
+
value: function _offsetInfo(localDateTime) {
|
|
200
|
+
var index = ldtBinarySearch(this._ldtUntils, localDateTime);
|
|
201
|
+
var offsetIndex = index >> 1;
|
|
213
202
|
|
|
214
|
-
|
|
215
|
-
|
|
203
|
+
if (index % 2 === 1) {
|
|
204
|
+
var ldtBefore = this._ldtUntils.get(Math.max(index - 1, 0));
|
|
216
205
|
|
|
217
|
-
|
|
218
|
-
notSupported('ZoneRules.standardOffset');
|
|
219
|
-
};
|
|
206
|
+
var ldtAfter = this._ldtUntils.get(Math.min(index, this._ldtUntils.size - 1));
|
|
220
207
|
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
};
|
|
208
|
+
var offsetBefore = _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ZoneOffset"].ofTotalSeconds(this._offsetByIndexInSeconds(offsetIndex));
|
|
209
|
+
var offsetAfter = _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ZoneOffset"].ofTotalSeconds(this._offsetByIndexInSeconds(Math.min(offsetIndex + 1, this._tzdbInfo.offsets.length - 1)));
|
|
224
210
|
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
return o.equals(offset);
|
|
232
|
-
});
|
|
233
|
-
};
|
|
211
|
+
if (offsetBefore.compareTo(offsetAfter) > 0) {
|
|
212
|
+
return _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ZoneOffsetTransition"].of(ldtBefore, offsetBefore, offsetAfter);
|
|
213
|
+
} else {
|
|
214
|
+
return _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ZoneOffsetTransition"].of(ldtAfter, offsetBefore, offsetAfter);
|
|
215
|
+
}
|
|
216
|
+
}
|
|
234
217
|
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
}
|
|
218
|
+
return _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ZoneOffset"].ofTotalSeconds(this._offsetByIndexInSeconds(offsetIndex));
|
|
219
|
+
}
|
|
220
|
+
}, {
|
|
221
|
+
key: "_offsetByIndexInSeconds",
|
|
222
|
+
value: function _offsetByIndexInSeconds(index) {
|
|
223
|
+
return -offsetInSeconds(this._tzdbInfo.offsets[index]);
|
|
224
|
+
}
|
|
225
|
+
}, {
|
|
226
|
+
key: "validOffsets",
|
|
227
|
+
value: function validOffsets(localDateTime) {
|
|
228
|
+
var info = this._offsetInfo(localDateTime);
|
|
238
229
|
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
230
|
+
if (info instanceof _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ZoneOffsetTransition"]) {
|
|
231
|
+
return info.validOffsets();
|
|
232
|
+
}
|
|
242
233
|
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
}
|
|
234
|
+
return [info];
|
|
235
|
+
}
|
|
236
|
+
}, {
|
|
237
|
+
key: "transition",
|
|
238
|
+
value: function transition(localDateTime) {
|
|
239
|
+
var info = this._offsetInfo(localDateTime);
|
|
246
240
|
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
241
|
+
if (info instanceof _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ZoneOffsetTransition"]) {
|
|
242
|
+
return info;
|
|
243
|
+
}
|
|
250
244
|
|
|
251
|
-
|
|
252
|
-
if (this === other) {
|
|
253
|
-
return true;
|
|
245
|
+
return null;
|
|
254
246
|
}
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
247
|
+
}, {
|
|
248
|
+
key: "standardOffset",
|
|
249
|
+
value: function standardOffset(instant) {
|
|
250
|
+
notSupported('ZoneRules.standardOffset');
|
|
251
|
+
}
|
|
252
|
+
}, {
|
|
253
|
+
key: "daylightSavings",
|
|
254
|
+
value: function daylightSavings(instant) {
|
|
255
|
+
notSupported('ZoneRules.daylightSavings');
|
|
256
|
+
}
|
|
257
|
+
}, {
|
|
258
|
+
key: "isDaylightSavings",
|
|
259
|
+
value: function isDaylightSavings(instant) {
|
|
260
|
+
notSupported('ZoneRules.isDaylightSavings');
|
|
261
|
+
}
|
|
262
|
+
}, {
|
|
263
|
+
key: "isValidOffset",
|
|
264
|
+
value: function isValidOffset(localDateTime, offset) {
|
|
265
|
+
return this.validOffsets(localDateTime).some(function (o) {
|
|
266
|
+
return o.equals(offset);
|
|
267
|
+
});
|
|
258
268
|
}
|
|
269
|
+
}, {
|
|
270
|
+
key: "nextTransition",
|
|
271
|
+
value: function nextTransition(instant) {
|
|
272
|
+
notSupported('ZoneRules.nextTransition');
|
|
273
|
+
}
|
|
274
|
+
}, {
|
|
275
|
+
key: "previousTransition",
|
|
276
|
+
value: function previousTransition(instant) {
|
|
277
|
+
notSupported('ZoneRules.previousTransition');
|
|
278
|
+
}
|
|
279
|
+
}, {
|
|
280
|
+
key: "transitions",
|
|
281
|
+
value: function transitions() {
|
|
282
|
+
notSupported('ZoneRules.transitions');
|
|
283
|
+
}
|
|
284
|
+
}, {
|
|
285
|
+
key: "transitionRules",
|
|
286
|
+
value: function transitionRules() {
|
|
287
|
+
notSupported('ZoneRules.transitionRules');
|
|
288
|
+
}
|
|
289
|
+
}, {
|
|
290
|
+
key: "equals",
|
|
291
|
+
value: function equals(other) {
|
|
292
|
+
if (this === other) {
|
|
293
|
+
return true;
|
|
294
|
+
}
|
|
259
295
|
|
|
260
|
-
|
|
261
|
-
|
|
296
|
+
if (other instanceof MomentZoneRules) {
|
|
297
|
+
return this._tzdbInfo === other._tzdbInfo;
|
|
298
|
+
}
|
|
262
299
|
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
}
|
|
300
|
+
return false;
|
|
301
|
+
}
|
|
302
|
+
}, {
|
|
303
|
+
key: "toString",
|
|
304
|
+
value: function toString() {
|
|
305
|
+
return this._tzdbInfo.name;
|
|
306
|
+
}
|
|
307
|
+
}]);
|
|
266
308
|
|
|
267
309
|
return MomentZoneRules;
|
|
268
310
|
}(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ZoneRules"]);
|
|
269
311
|
|
|
270
312
|
var LDTUntils = function () {
|
|
271
313
|
function LDTUntils(_tzdbUntils, tzdbOffsets) {
|
|
314
|
+
_classCallCheck(this, LDTUntils);
|
|
315
|
+
|
|
272
316
|
this._tzdbUntils = _tzdbUntils;
|
|
273
317
|
this._tzdbOffsets = tzdbOffsets;
|
|
274
318
|
this._ldtUntils = [];
|
|
275
319
|
this.size = this._tzdbUntils.length * 2;
|
|
276
320
|
}
|
|
277
321
|
|
|
278
|
-
|
|
322
|
+
_createClass(LDTUntils, [{
|
|
323
|
+
key: "_generateTupple",
|
|
324
|
+
value: function _generateTupple(index) {
|
|
325
|
+
var epochMillis = this._tzdbUntils[index];
|
|
279
326
|
|
|
280
|
-
|
|
281
|
-
|
|
327
|
+
if (epochMillis === Infinity) {
|
|
328
|
+
return [_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["LocalDateTime"].MAX, _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["LocalDateTime"].MAX];
|
|
329
|
+
}
|
|
282
330
|
|
|
283
|
-
|
|
284
|
-
|
|
331
|
+
var instant = _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["Instant"].ofEpochMilli(epochMillis);
|
|
332
|
+
var offset1 = offsetInSeconds(this._tzdbOffsets[index]);
|
|
333
|
+
var zone1 = _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ZoneOffset"].ofTotalSeconds(-offset1);
|
|
334
|
+
var ldt1 = _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["LocalDateTime"].ofInstant(instant, zone1);
|
|
335
|
+
var nextIndex = Math.min(index + 1, this._tzdbOffsets.length - 1);
|
|
336
|
+
var offset2 = offsetInSeconds(this._tzdbOffsets[nextIndex]);
|
|
337
|
+
var zone2 = _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ZoneOffset"].ofTotalSeconds(-offset2);
|
|
338
|
+
var ldt2 = _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["LocalDateTime"].ofInstant(instant, zone2);
|
|
339
|
+
|
|
340
|
+
if (offset1 > offset2) {
|
|
341
|
+
return [ldt1, ldt2];
|
|
342
|
+
} else {
|
|
343
|
+
return [ldt2, ldt1];
|
|
344
|
+
}
|
|
285
345
|
}
|
|
346
|
+
}, {
|
|
347
|
+
key: "_getTupple",
|
|
348
|
+
value: function _getTupple(index) {
|
|
349
|
+
if (this._ldtUntils[index] == null) {
|
|
350
|
+
this._ldtUntils[index] = this._generateTupple(index);
|
|
351
|
+
}
|
|
286
352
|
|
|
287
|
-
|
|
288
|
-
var offset1 = offsetInSeconds(this._tzdbOffsets[index]);
|
|
289
|
-
var zone1 = _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ZoneOffset"].ofTotalSeconds(-offset1);
|
|
290
|
-
var ldt1 = _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["LocalDateTime"].ofInstant(instant, zone1);
|
|
291
|
-
var nextIndex = Math.min(index + 1, this._tzdbOffsets.length - 1);
|
|
292
|
-
var offset2 = offsetInSeconds(this._tzdbOffsets[nextIndex]);
|
|
293
|
-
var zone2 = _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ZoneOffset"].ofTotalSeconds(-offset2);
|
|
294
|
-
var ldt2 = _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["LocalDateTime"].ofInstant(instant, zone2);
|
|
295
|
-
|
|
296
|
-
if (offset1 > offset2) {
|
|
297
|
-
return [ldt1, ldt2];
|
|
298
|
-
} else {
|
|
299
|
-
return [ldt2, ldt1];
|
|
353
|
+
return this._ldtUntils[index];
|
|
300
354
|
}
|
|
301
|
-
}
|
|
355
|
+
}, {
|
|
356
|
+
key: "get",
|
|
357
|
+
value: function get(index) {
|
|
358
|
+
var ldtTupple = this._getTupple(index >> 1);
|
|
302
359
|
|
|
303
|
-
|
|
304
|
-
if (this._ldtUntils[index] == null) {
|
|
305
|
-
this._ldtUntils[index] = this._generateTupple(index);
|
|
360
|
+
return ldtTupple[index % 2];
|
|
306
361
|
}
|
|
307
|
-
|
|
308
|
-
return this._ldtUntils[index];
|
|
309
|
-
};
|
|
310
|
-
|
|
311
|
-
_proto2.get = function get(index) {
|
|
312
|
-
var ldtTupple = this._getTupple(index >> 1);
|
|
313
|
-
|
|
314
|
-
return ldtTupple[index % 2];
|
|
315
|
-
};
|
|
362
|
+
}]);
|
|
316
363
|
|
|
317
364
|
return LDTUntils;
|
|
318
365
|
}();
|
|
@@ -362,7 +409,7 @@ function binarySearch(array, value) {
|
|
|
362
409
|
}
|
|
363
410
|
|
|
364
411
|
function notSupported(msg) {
|
|
365
|
-
throw new Error(
|
|
412
|
+
throw new Error("not supported: ".concat(msg));
|
|
366
413
|
}
|
|
367
414
|
|
|
368
415
|
/***/ }),
|
|
@@ -381,7 +428,33 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
381
428
|
/* harmony import */ var _js_joda_core__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__);
|
|
382
429
|
/* harmony import */ var _MomentZoneRules__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./MomentZoneRules */ "./src/MomentZoneRules.js");
|
|
383
430
|
/* harmony import */ var _unpack__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./unpack */ "./src/unpack.js");
|
|
384
|
-
function
|
|
431
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
432
|
+
|
|
433
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
434
|
+
|
|
435
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
436
|
+
|
|
437
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
438
|
+
|
|
439
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
440
|
+
|
|
441
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
442
|
+
|
|
443
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
444
|
+
|
|
445
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
446
|
+
|
|
447
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
448
|
+
|
|
449
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
450
|
+
|
|
451
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
452
|
+
|
|
453
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
454
|
+
|
|
455
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
456
|
+
|
|
457
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
385
458
|
|
|
386
459
|
/*
|
|
387
460
|
* @copyright (c) 2016-present, Philipp Thürwächter, Pattrick Hüper
|
|
@@ -397,75 +470,82 @@ var AVAILABLE_ZONE_IDS = [];
|
|
|
397
470
|
var zones = {};
|
|
398
471
|
var links = {};
|
|
399
472
|
var MomentZoneRulesProvider = function (_ZoneRulesProvider) {
|
|
400
|
-
|
|
473
|
+
_inherits(MomentZoneRulesProvider, _ZoneRulesProvider);
|
|
401
474
|
|
|
402
|
-
|
|
403
|
-
return _ZoneRulesProvider.apply(this, arguments) || this;
|
|
404
|
-
}
|
|
405
|
-
|
|
406
|
-
MomentZoneRulesProvider.getRules = function getRules(zoneId) {
|
|
407
|
-
var tzdbZoneInfo = zones[links[zoneId]];
|
|
408
|
-
|
|
409
|
-
if (tzdbZoneInfo == null) {
|
|
410
|
-
throw new _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["DateTimeException"]('Unknown time-zone ID: ' + zoneId);
|
|
411
|
-
}
|
|
412
|
-
|
|
413
|
-
return new _MomentZoneRules__WEBPACK_IMPORTED_MODULE_1__["MomentZoneRules"](tzdbZoneInfo);
|
|
414
|
-
};
|
|
415
|
-
|
|
416
|
-
MomentZoneRulesProvider.getAvailableZoneIds = function getAvailableZoneIds() {
|
|
417
|
-
return AVAILABLE_ZONE_IDS;
|
|
418
|
-
};
|
|
475
|
+
var _super = _createSuper(MomentZoneRulesProvider);
|
|
419
476
|
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
};
|
|
423
|
-
|
|
424
|
-
MomentZoneRulesProvider.getTzdbData = function getTzdbData() {
|
|
425
|
-
return TZDB_DATA;
|
|
426
|
-
};
|
|
477
|
+
function MomentZoneRulesProvider() {
|
|
478
|
+
_classCallCheck(this, MomentZoneRulesProvider);
|
|
427
479
|
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
TZDB_VERSION = packedJson.version;
|
|
480
|
+
return _super.apply(this, arguments);
|
|
481
|
+
}
|
|
431
482
|
|
|
432
|
-
|
|
433
|
-
|
|
483
|
+
_createClass(MomentZoneRulesProvider, null, [{
|
|
484
|
+
key: "getRules",
|
|
485
|
+
value: function getRules(zoneId) {
|
|
486
|
+
var tzdbZoneInfo = zones[links[zoneId]];
|
|
434
487
|
|
|
435
|
-
if (
|
|
436
|
-
|
|
437
|
-
_ref = _iterator[_i++];
|
|
438
|
-
} else {
|
|
439
|
-
_i = _iterator.next();
|
|
440
|
-
if (_i.done) break;
|
|
441
|
-
_ref = _i.value;
|
|
488
|
+
if (tzdbZoneInfo == null) {
|
|
489
|
+
throw new _js_joda_core__WEBPACK_IMPORTED_MODULE_0__["DateTimeException"]("Unknown time-zone ID: ".concat(zoneId));
|
|
442
490
|
}
|
|
443
491
|
|
|
444
|
-
|
|
445
|
-
var tzdbZoneInfo = Object(_unpack__WEBPACK_IMPORTED_MODULE_2__["unpack"])(packedZoneInfo);
|
|
446
|
-
AVAILABLE_ZONE_IDS.push(tzdbZoneInfo.name);
|
|
447
|
-
zones[tzdbZoneInfo.name] = tzdbZoneInfo;
|
|
448
|
-
links[tzdbZoneInfo.name] = tzdbZoneInfo.name;
|
|
492
|
+
return new _MomentZoneRules__WEBPACK_IMPORTED_MODULE_1__["MomentZoneRules"](tzdbZoneInfo);
|
|
449
493
|
}
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
494
|
+
}, {
|
|
495
|
+
key: "getAvailableZoneIds",
|
|
496
|
+
value: function getAvailableZoneIds() {
|
|
497
|
+
return AVAILABLE_ZONE_IDS;
|
|
498
|
+
}
|
|
499
|
+
}, {
|
|
500
|
+
key: "getVersion",
|
|
501
|
+
value: function getVersion() {
|
|
502
|
+
return TZDB_VERSION;
|
|
503
|
+
}
|
|
504
|
+
}, {
|
|
505
|
+
key: "getTzdbData",
|
|
506
|
+
value: function getTzdbData() {
|
|
507
|
+
return TZDB_DATA;
|
|
508
|
+
}
|
|
509
|
+
}, {
|
|
510
|
+
key: "loadTzdbData",
|
|
511
|
+
value: function loadTzdbData(packedJson) {
|
|
512
|
+
TZDB_DATA = packedJson;
|
|
513
|
+
TZDB_VERSION = packedJson.version;
|
|
514
|
+
|
|
515
|
+
var _iterator = _createForOfIteratorHelper(packedJson.zones),
|
|
516
|
+
_step;
|
|
517
|
+
|
|
518
|
+
try {
|
|
519
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
520
|
+
var packedZoneInfo = _step.value;
|
|
521
|
+
var tzdbZoneInfo = Object(_unpack__WEBPACK_IMPORTED_MODULE_2__["unpack"])(packedZoneInfo);
|
|
522
|
+
AVAILABLE_ZONE_IDS.push(tzdbZoneInfo.name);
|
|
523
|
+
zones[tzdbZoneInfo.name] = tzdbZoneInfo;
|
|
524
|
+
links[tzdbZoneInfo.name] = tzdbZoneInfo.name;
|
|
525
|
+
}
|
|
526
|
+
} catch (err) {
|
|
527
|
+
_iterator.e(err);
|
|
528
|
+
} finally {
|
|
529
|
+
_iterator.f();
|
|
461
530
|
}
|
|
462
531
|
|
|
463
|
-
var
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
532
|
+
var _iterator2 = _createForOfIteratorHelper(packedJson.links),
|
|
533
|
+
_step2;
|
|
534
|
+
|
|
535
|
+
try {
|
|
536
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
537
|
+
var packedLink = _step2.value;
|
|
538
|
+
var link = packedLink.split('|');
|
|
539
|
+
AVAILABLE_ZONE_IDS.push(link[1]);
|
|
540
|
+
links[link[1]] = link[0];
|
|
541
|
+
}
|
|
542
|
+
} catch (err) {
|
|
543
|
+
_iterator2.e(err);
|
|
544
|
+
} finally {
|
|
545
|
+
_iterator2.f();
|
|
546
|
+
}
|
|
467
547
|
}
|
|
468
|
-
};
|
|
548
|
+
}]);
|
|
469
549
|
|
|
470
550
|
return MomentZoneRulesProvider;
|
|
471
551
|
}(_js_joda_core__WEBPACK_IMPORTED_MODULE_0__["ZoneRulesProvider"]);
|