@js-joda/core 6.0.0 → 6.1.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/README.md +0 -2
- package/dist/js-joda.cjs.js +265 -263
- package/dist/js-joda.cjs.js.map +1 -1
- package/dist/js-joda.esm.js +265 -263
- package/dist/js-joda.esm.js.map +1 -1
- package/dist/js-joda.js +265 -263
- package/dist/js-joda.js.map +1 -1
- package/dist/js-joda.min.js +2 -2
- package/package.json +2 -2
- package/src/Duration.js +32 -23
- package/src/Instant.js +1 -1
- package/src/format/DateTimeFormatterBuilder.js +6 -2
- package/src/format/DateTimeParseContext.js +2 -0
- package/src/format/parser/ZoneIdPrinterParser.js +62 -28
- package/typings/js-joda.flow.js +1 -1
package/dist/js-joda.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//! @version @js-joda/core - 6.
|
|
1
|
+
//! @version @js-joda/core - 6.1.0
|
|
2
2
|
//! @copyright (c) 2015-present, Philipp Thürwächter, Pattrick Hüper & js-joda contributors
|
|
3
3
|
//! @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos
|
|
4
4
|
//! @license BSD-3-Clause (see LICENSE in the root directory of this source tree)
|
|
@@ -70,23 +70,17 @@ function messageForDateTimeParseException(message, text, index, cause) {
|
|
|
70
70
|
};
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
-
function
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
_setPrototypeOf(subClass, superClass);
|
|
73
|
+
function _assertThisInitialized(e) {
|
|
74
|
+
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
75
|
+
return e;
|
|
77
76
|
}
|
|
78
|
-
function
|
|
79
|
-
|
|
80
|
-
o.__proto__ = p;
|
|
81
|
-
return o;
|
|
82
|
-
};
|
|
83
|
-
return _setPrototypeOf(o, p);
|
|
77
|
+
function _inheritsLoose(t, o) {
|
|
78
|
+
t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o);
|
|
84
79
|
}
|
|
85
|
-
function
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
}
|
|
89
|
-
return self;
|
|
80
|
+
function _setPrototypeOf(t, e) {
|
|
81
|
+
return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
|
|
82
|
+
return t.__proto__ = e, t;
|
|
83
|
+
}, _setPrototypeOf(t, e);
|
|
90
84
|
}
|
|
91
85
|
|
|
92
86
|
/**
|
|
@@ -205,18 +199,10 @@ var MathUtil = function () {
|
|
|
205
199
|
}
|
|
206
200
|
return r;
|
|
207
201
|
};
|
|
208
|
-
MathUtil.parseInt = function (
|
|
209
|
-
function parseInt(_x) {
|
|
210
|
-
return _parseInt.apply(this, arguments);
|
|
211
|
-
}
|
|
212
|
-
parseInt.toString = function () {
|
|
213
|
-
return _parseInt.toString();
|
|
214
|
-
};
|
|
215
|
-
return parseInt;
|
|
216
|
-
}(function (value) {
|
|
202
|
+
MathUtil.parseInt = function (value) {
|
|
217
203
|
var r = parseInt(value);
|
|
218
204
|
return MathUtil.safeToInt(r);
|
|
219
|
-
}
|
|
205
|
+
};
|
|
220
206
|
MathUtil.safeToInt = function safeToInt(value) {
|
|
221
207
|
MathUtil.verifyInt(value);
|
|
222
208
|
return MathUtil.safeZero(value);
|
|
@@ -363,7 +349,6 @@ var TemporalUnit = function () {
|
|
|
363
349
|
}();
|
|
364
350
|
|
|
365
351
|
var Duration = function (_TemporalAmount) {
|
|
366
|
-
_inheritsLoose(Duration, _TemporalAmount);
|
|
367
352
|
function Duration(seconds, nanos) {
|
|
368
353
|
var _this;
|
|
369
354
|
_this = _TemporalAmount.call(this) || this;
|
|
@@ -371,6 +356,7 @@ var Duration = function (_TemporalAmount) {
|
|
|
371
356
|
_this._nanos = MathUtil.safeToInt(nanos);
|
|
372
357
|
return _this;
|
|
373
358
|
}
|
|
359
|
+
_inheritsLoose(Duration, _TemporalAmount);
|
|
374
360
|
Duration.ofDays = function ofDays(days) {
|
|
375
361
|
return Duration._create(MathUtil.safeMultiply(days, LocalTime.SECONDS_PER_DAY), 0);
|
|
376
362
|
};
|
|
@@ -761,9 +747,12 @@ var Duration = function (_TemporalAmount) {
|
|
|
761
747
|
if (this === Duration.ZERO) {
|
|
762
748
|
return 'PT0S';
|
|
763
749
|
}
|
|
764
|
-
var
|
|
765
|
-
var
|
|
766
|
-
var
|
|
750
|
+
var negativeFraction = this._seconds < 0 && this._nanos > 0;
|
|
751
|
+
var wholeSeconds = negativeFraction ? this._seconds + 1 : this._seconds;
|
|
752
|
+
var fractionNanos = negativeFraction ? LocalTime.NANOS_PER_SECOND - this._nanos : this._nanos;
|
|
753
|
+
var hours = MathUtil.intDiv(wholeSeconds, LocalTime.SECONDS_PER_HOUR);
|
|
754
|
+
var minutes = MathUtil.intDiv(MathUtil.intMod(wholeSeconds, LocalTime.SECONDS_PER_HOUR), LocalTime.SECONDS_PER_MINUTE);
|
|
755
|
+
var secs = MathUtil.intMod(wholeSeconds, LocalTime.SECONDS_PER_MINUTE);
|
|
767
756
|
var rval = 'PT';
|
|
768
757
|
if (hours !== 0) {
|
|
769
758
|
rval += hours + "H";
|
|
@@ -771,31 +760,23 @@ var Duration = function (_TemporalAmount) {
|
|
|
771
760
|
if (minutes !== 0) {
|
|
772
761
|
rval += minutes + "M";
|
|
773
762
|
}
|
|
774
|
-
if (secs === 0 &&
|
|
763
|
+
if (secs === 0 && fractionNanos === 0 && rval.length > 2) {
|
|
775
764
|
return rval;
|
|
776
765
|
}
|
|
777
|
-
if (secs
|
|
778
|
-
|
|
779
|
-
rval += '-0';
|
|
780
|
-
} else {
|
|
781
|
-
rval += secs + 1;
|
|
782
|
-
}
|
|
766
|
+
if (secs === 0 && negativeFraction) {
|
|
767
|
+
rval += '-0';
|
|
783
768
|
} else {
|
|
784
|
-
rval += secs;
|
|
769
|
+
rval += "" + secs;
|
|
785
770
|
}
|
|
786
|
-
if (
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
nanoString = "" + (2 * LocalTime.NANOS_PER_SECOND - this._nanos);
|
|
791
|
-
} else {
|
|
792
|
-
nanoString = "" + (LocalTime.NANOS_PER_SECOND + this._nanos);
|
|
771
|
+
if (fractionNanos > 0) {
|
|
772
|
+
var fraction = "" + fractionNanos;
|
|
773
|
+
while (fraction.length < 9) {
|
|
774
|
+
fraction = "0" + fraction;
|
|
793
775
|
}
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
while (rval.charAt(rval.length - 1) === '0') {
|
|
797
|
-
rval = rval.slice(0, rval.length - 1);
|
|
776
|
+
while (fraction.charAt(fraction.length - 1) === '0') {
|
|
777
|
+
fraction = fraction.slice(0, fraction.length - 1);
|
|
798
778
|
}
|
|
779
|
+
rval += "." + fraction;
|
|
799
780
|
}
|
|
800
781
|
rval += 'S';
|
|
801
782
|
return rval;
|
|
@@ -819,7 +800,6 @@ function _init$m() {
|
|
|
819
800
|
}
|
|
820
801
|
|
|
821
802
|
var ChronoUnit = function (_TemporalUnit) {
|
|
822
|
-
_inheritsLoose(ChronoUnit, _TemporalUnit);
|
|
823
803
|
function ChronoUnit(name, estimatedDuration) {
|
|
824
804
|
var _this;
|
|
825
805
|
_this = _TemporalUnit.call(this) || this;
|
|
@@ -827,6 +807,7 @@ var ChronoUnit = function (_TemporalUnit) {
|
|
|
827
807
|
_this._duration = estimatedDuration;
|
|
828
808
|
return _this;
|
|
829
809
|
}
|
|
810
|
+
_inheritsLoose(ChronoUnit, _TemporalUnit);
|
|
830
811
|
var _proto = ChronoUnit.prototype;
|
|
831
812
|
_proto.duration = function duration() {
|
|
832
813
|
return this._duration;
|
|
@@ -1028,6 +1009,15 @@ var ValueRange = function () {
|
|
|
1028
1009
|
}();
|
|
1029
1010
|
|
|
1030
1011
|
var ChronoField = function (_TemporalField) {
|
|
1012
|
+
function ChronoField(name, baseUnit, rangeUnit, range) {
|
|
1013
|
+
var _this;
|
|
1014
|
+
_this = _TemporalField.call(this) || this;
|
|
1015
|
+
_this._name = name;
|
|
1016
|
+
_this._baseUnit = baseUnit;
|
|
1017
|
+
_this._rangeUnit = rangeUnit;
|
|
1018
|
+
_this._range = range;
|
|
1019
|
+
return _this;
|
|
1020
|
+
}
|
|
1031
1021
|
_inheritsLoose(ChronoField, _TemporalField);
|
|
1032
1022
|
ChronoField.byName = function byName(fieldName) {
|
|
1033
1023
|
for (var prop in ChronoField) {
|
|
@@ -1038,15 +1028,6 @@ var ChronoField = function (_TemporalField) {
|
|
|
1038
1028
|
}
|
|
1039
1029
|
}
|
|
1040
1030
|
};
|
|
1041
|
-
function ChronoField(name, baseUnit, rangeUnit, range) {
|
|
1042
|
-
var _this;
|
|
1043
|
-
_this = _TemporalField.call(this) || this;
|
|
1044
|
-
_this._name = name;
|
|
1045
|
-
_this._baseUnit = baseUnit;
|
|
1046
|
-
_this._rangeUnit = rangeUnit;
|
|
1047
|
-
_this._range = range;
|
|
1048
|
-
return _this;
|
|
1049
|
-
}
|
|
1050
1031
|
var _proto = ChronoField.prototype;
|
|
1051
1032
|
_proto.name = function name() {
|
|
1052
1033
|
return this._name;
|
|
@@ -1197,10 +1178,10 @@ var TemporalAccessor = function () {
|
|
|
1197
1178
|
}();
|
|
1198
1179
|
|
|
1199
1180
|
var TemporalQuery = function (_Enum) {
|
|
1200
|
-
_inheritsLoose(TemporalQuery, _Enum);
|
|
1201
1181
|
function TemporalQuery() {
|
|
1202
1182
|
return _Enum.apply(this, arguments) || this;
|
|
1203
1183
|
}
|
|
1184
|
+
_inheritsLoose(TemporalQuery, _Enum);
|
|
1204
1185
|
var _proto = TemporalQuery.prototype;
|
|
1205
1186
|
_proto.queryFrom = function queryFrom(temporal) {
|
|
1206
1187
|
abstractMethodFail('queryFrom');
|
|
@@ -1209,10 +1190,10 @@ var TemporalQuery = function (_Enum) {
|
|
|
1209
1190
|
}(Enum);
|
|
1210
1191
|
function createTemporalQuery(name, queryFromFunction) {
|
|
1211
1192
|
var ExtendedTemporalQuery = function (_TemporalQuery) {
|
|
1212
|
-
_inheritsLoose(ExtendedTemporalQuery, _TemporalQuery);
|
|
1213
1193
|
function ExtendedTemporalQuery() {
|
|
1214
1194
|
return _TemporalQuery.apply(this, arguments) || this;
|
|
1215
1195
|
}
|
|
1196
|
+
_inheritsLoose(ExtendedTemporalQuery, _TemporalQuery);
|
|
1216
1197
|
return ExtendedTemporalQuery;
|
|
1217
1198
|
}(TemporalQuery);
|
|
1218
1199
|
ExtendedTemporalQuery.prototype.queryFrom = queryFromFunction;
|
|
@@ -1220,7 +1201,6 @@ function createTemporalQuery(name, queryFromFunction) {
|
|
|
1220
1201
|
}
|
|
1221
1202
|
|
|
1222
1203
|
var DayOfWeek = function (_TemporalAccessor) {
|
|
1223
|
-
_inheritsLoose(DayOfWeek, _TemporalAccessor);
|
|
1224
1204
|
function DayOfWeek(ordinal, name) {
|
|
1225
1205
|
var _this;
|
|
1226
1206
|
_this = _TemporalAccessor.call(this) || this;
|
|
@@ -1228,6 +1208,7 @@ var DayOfWeek = function (_TemporalAccessor) {
|
|
|
1228
1208
|
_this._name = name;
|
|
1229
1209
|
return _this;
|
|
1230
1210
|
}
|
|
1211
|
+
_inheritsLoose(DayOfWeek, _TemporalAccessor);
|
|
1231
1212
|
var _proto = DayOfWeek.prototype;
|
|
1232
1213
|
_proto.ordinal = function ordinal() {
|
|
1233
1214
|
return this._ordinal;
|
|
@@ -1354,7 +1335,6 @@ function _init$j() {
|
|
|
1354
1335
|
}
|
|
1355
1336
|
|
|
1356
1337
|
var Month = function (_TemporalAccessor) {
|
|
1357
|
-
_inheritsLoose(Month, _TemporalAccessor);
|
|
1358
1338
|
function Month(value, name) {
|
|
1359
1339
|
var _this;
|
|
1360
1340
|
_this = _TemporalAccessor.call(this) || this;
|
|
@@ -1362,6 +1342,7 @@ var Month = function (_TemporalAccessor) {
|
|
|
1362
1342
|
_this._name = name;
|
|
1363
1343
|
return _this;
|
|
1364
1344
|
}
|
|
1345
|
+
_inheritsLoose(Month, _TemporalAccessor);
|
|
1365
1346
|
var _proto = Month.prototype;
|
|
1366
1347
|
_proto.value = function value() {
|
|
1367
1348
|
return this._value;
|
|
@@ -1599,7 +1580,6 @@ function _init$i() {
|
|
|
1599
1580
|
|
|
1600
1581
|
var PATTERN = /([-+]?)P(?:([-+]?[0-9]+)Y)?(?:([-+]?[0-9]+)M)?(?:([-+]?[0-9]+)W)?(?:([-+]?[0-9]+)D)?/;
|
|
1601
1582
|
var Period = function (_TemporalAmount) {
|
|
1602
|
-
_inheritsLoose(Period, _TemporalAmount);
|
|
1603
1583
|
function Period(years, months, days) {
|
|
1604
1584
|
var _this;
|
|
1605
1585
|
_this = _TemporalAmount.call(this) || this;
|
|
@@ -1611,7 +1591,7 @@ var Period = function (_TemporalAmount) {
|
|
|
1611
1591
|
_this._years = _years;
|
|
1612
1592
|
_this._months = _months;
|
|
1613
1593
|
_this._days = _days;
|
|
1614
|
-
Period.ZERO =
|
|
1594
|
+
Period.ZERO = _this;
|
|
1615
1595
|
}
|
|
1616
1596
|
return Period.ZERO || _assertThisInitialized(_this);
|
|
1617
1597
|
}
|
|
@@ -1620,6 +1600,7 @@ var Period = function (_TemporalAmount) {
|
|
|
1620
1600
|
_this._days = _days;
|
|
1621
1601
|
return _this;
|
|
1622
1602
|
}
|
|
1603
|
+
_inheritsLoose(Period, _TemporalAmount);
|
|
1623
1604
|
Period.ofYears = function ofYears(years) {
|
|
1624
1605
|
return Period.create(years, 0, 0);
|
|
1625
1606
|
};
|
|
@@ -1963,10 +1944,10 @@ function _init$h() {
|
|
|
1963
1944
|
}();
|
|
1964
1945
|
|
|
1965
1946
|
var ResolverStyle = function (_Enum) {
|
|
1966
|
-
_inheritsLoose(ResolverStyle, _Enum);
|
|
1967
1947
|
function ResolverStyle() {
|
|
1968
1948
|
return _Enum.apply(this, arguments) || this;
|
|
1969
1949
|
}
|
|
1950
|
+
_inheritsLoose(ResolverStyle, _Enum);
|
|
1970
1951
|
return ResolverStyle;
|
|
1971
1952
|
}(Enum);
|
|
1972
1953
|
ResolverStyle.STRICT = new ResolverStyle('STRICT');
|
|
@@ -1974,10 +1955,10 @@ ResolverStyle.SMART = new ResolverStyle('SMART');
|
|
|
1974
1955
|
ResolverStyle.LENIENT = new ResolverStyle('LENIENT');
|
|
1975
1956
|
|
|
1976
1957
|
var Temporal = function (_TemporalAccessor) {
|
|
1977
|
-
_inheritsLoose(Temporal, _TemporalAccessor);
|
|
1978
1958
|
function Temporal() {
|
|
1979
1959
|
return _TemporalAccessor.apply(this, arguments) || this;
|
|
1980
1960
|
}
|
|
1961
|
+
_inheritsLoose(Temporal, _TemporalAccessor);
|
|
1981
1962
|
var _proto = Temporal.prototype;
|
|
1982
1963
|
_proto.isSupported = function isSupported(fieldOrUnit) {
|
|
1983
1964
|
abstractMethodFail('isSupported');
|
|
@@ -2045,10 +2026,10 @@ if (typeof Symbol !== 'undefined' && Symbol.toPrimitive) {
|
|
|
2045
2026
|
}
|
|
2046
2027
|
|
|
2047
2028
|
var ChronoLocalDate = function (_Temporal) {
|
|
2048
|
-
_inheritsLoose(ChronoLocalDate, _Temporal);
|
|
2049
2029
|
function ChronoLocalDate() {
|
|
2050
2030
|
return _Temporal.apply(this, arguments) || this;
|
|
2051
2031
|
}
|
|
2032
|
+
_inheritsLoose(ChronoLocalDate, _Temporal);
|
|
2052
2033
|
var _proto = ChronoLocalDate.prototype;
|
|
2053
2034
|
_proto.isSupported = function isSupported(fieldOrUnit) {
|
|
2054
2035
|
if (fieldOrUnit instanceof ChronoField) {
|
|
@@ -2230,13 +2211,13 @@ var ZoneRules = function () {
|
|
|
2230
2211
|
return ZoneRules;
|
|
2231
2212
|
}();
|
|
2232
2213
|
var Fixed = function (_ZoneRules) {
|
|
2233
|
-
_inheritsLoose(Fixed, _ZoneRules);
|
|
2234
2214
|
function Fixed(offset) {
|
|
2235
2215
|
var _this;
|
|
2236
2216
|
_this = _ZoneRules.call(this) || this;
|
|
2237
2217
|
_this._offset = offset;
|
|
2238
2218
|
return _this;
|
|
2239
2219
|
}
|
|
2220
|
+
_inheritsLoose(Fixed, _ZoneRules);
|
|
2240
2221
|
var _proto2 = Fixed.prototype;
|
|
2241
2222
|
_proto2.isFixedOffset = function isFixedOffset() {
|
|
2242
2223
|
return true;
|
|
@@ -2298,16 +2279,16 @@ var Fixed = function (_ZoneRules) {
|
|
|
2298
2279
|
var SECONDS_CACHE = {};
|
|
2299
2280
|
var ID_CACHE = {};
|
|
2300
2281
|
var ZoneOffset = function (_ZoneId) {
|
|
2301
|
-
_inheritsLoose(ZoneOffset, _ZoneId);
|
|
2302
2282
|
function ZoneOffset(totalSeconds) {
|
|
2303
2283
|
var _this;
|
|
2304
2284
|
_this = _ZoneId.call(this) || this;
|
|
2305
2285
|
ZoneOffset._validateTotalSeconds(totalSeconds);
|
|
2306
2286
|
_this._totalSeconds = MathUtil.safeToInt(totalSeconds);
|
|
2307
|
-
_this._rules = ZoneRules.of(
|
|
2287
|
+
_this._rules = ZoneRules.of(_this);
|
|
2308
2288
|
_this._id = ZoneOffset._buildId(totalSeconds);
|
|
2309
2289
|
return _this;
|
|
2310
2290
|
}
|
|
2291
|
+
_inheritsLoose(ZoneOffset, _ZoneId);
|
|
2311
2292
|
var _proto = ZoneOffset.prototype;
|
|
2312
2293
|
_proto.totalSeconds = function totalSeconds() {
|
|
2313
2294
|
return this._totalSeconds;
|
|
@@ -2503,12 +2484,6 @@ function _init$g() {
|
|
|
2503
2484
|
}
|
|
2504
2485
|
|
|
2505
2486
|
var DateTimeBuilder = function (_TemporalAccessor) {
|
|
2506
|
-
_inheritsLoose(DateTimeBuilder, _TemporalAccessor);
|
|
2507
|
-
DateTimeBuilder.create = function create(field, value) {
|
|
2508
|
-
var dtb = new DateTimeBuilder();
|
|
2509
|
-
dtb._addFieldValue(field, value);
|
|
2510
|
-
return dtb;
|
|
2511
|
-
};
|
|
2512
2487
|
function DateTimeBuilder() {
|
|
2513
2488
|
var _this;
|
|
2514
2489
|
_this = _TemporalAccessor.call(this) || this;
|
|
@@ -2521,6 +2496,12 @@ var DateTimeBuilder = function (_TemporalAccessor) {
|
|
|
2521
2496
|
_this.excessDays = null;
|
|
2522
2497
|
return _this;
|
|
2523
2498
|
}
|
|
2499
|
+
_inheritsLoose(DateTimeBuilder, _TemporalAccessor);
|
|
2500
|
+
DateTimeBuilder.create = function create(field, value) {
|
|
2501
|
+
var dtb = new DateTimeBuilder();
|
|
2502
|
+
dtb._addFieldValue(field, value);
|
|
2503
|
+
return dtb;
|
|
2504
|
+
};
|
|
2524
2505
|
var _proto = DateTimeBuilder.prototype;
|
|
2525
2506
|
_proto.getFieldValue0 = function getFieldValue0(field) {
|
|
2526
2507
|
return this.fieldValues.get(field);
|
|
@@ -2958,7 +2939,6 @@ var DateTimeParseContext = function () {
|
|
|
2958
2939
|
return DateTimeParseContext;
|
|
2959
2940
|
}();
|
|
2960
2941
|
var Parsed = function (_Temporal) {
|
|
2961
|
-
_inheritsLoose(Parsed, _Temporal);
|
|
2962
2942
|
function Parsed(dateTimeParseContext) {
|
|
2963
2943
|
var _this;
|
|
2964
2944
|
_this = _Temporal.call(this) || this;
|
|
@@ -2966,9 +2946,11 @@ var Parsed = function (_Temporal) {
|
|
|
2966
2946
|
_this.zone = null;
|
|
2967
2947
|
_this.fieldValues = new EnumMap();
|
|
2968
2948
|
_this.leapSecond = false;
|
|
2949
|
+
_this.excessDays = Period.ZERO;
|
|
2969
2950
|
_this.dateTimeParseContext = dateTimeParseContext;
|
|
2970
2951
|
return _this;
|
|
2971
2952
|
}
|
|
2953
|
+
_inheritsLoose(Parsed, _Temporal);
|
|
2972
2954
|
var _proto2 = Parsed.prototype;
|
|
2973
2955
|
_proto2.copy = function copy() {
|
|
2974
2956
|
var cloned = new Parsed();
|
|
@@ -3082,10 +3064,10 @@ var DateTimePrintContext = function () {
|
|
|
3082
3064
|
var IsoFields = {};
|
|
3083
3065
|
var QUARTER_DAYS = [0, 90, 181, 273, 0, 91, 182, 274];
|
|
3084
3066
|
var Field = function (_TemporalField) {
|
|
3085
|
-
_inheritsLoose(Field, _TemporalField);
|
|
3086
3067
|
function Field() {
|
|
3087
3068
|
return _TemporalField.apply(this, arguments) || this;
|
|
3088
3069
|
}
|
|
3070
|
+
_inheritsLoose(Field, _TemporalField);
|
|
3089
3071
|
var _proto = Field.prototype;
|
|
3090
3072
|
_proto.isDateBased = function isDateBased() {
|
|
3091
3073
|
return true;
|
|
@@ -3157,10 +3139,10 @@ var Field = function (_TemporalField) {
|
|
|
3157
3139
|
return Field;
|
|
3158
3140
|
}(TemporalField);
|
|
3159
3141
|
var DAY_OF_QUARTER_FIELD = function (_Field) {
|
|
3160
|
-
_inheritsLoose(DAY_OF_QUARTER_FIELD, _Field);
|
|
3161
3142
|
function DAY_OF_QUARTER_FIELD() {
|
|
3162
3143
|
return _Field.apply(this, arguments) || this;
|
|
3163
3144
|
}
|
|
3145
|
+
_inheritsLoose(DAY_OF_QUARTER_FIELD, _Field);
|
|
3164
3146
|
var _proto2 = DAY_OF_QUARTER_FIELD.prototype;
|
|
3165
3147
|
_proto2.toString = function toString() {
|
|
3166
3148
|
return 'DayOfQuarter';
|
|
@@ -3243,10 +3225,10 @@ var DAY_OF_QUARTER_FIELD = function (_Field) {
|
|
|
3243
3225
|
return DAY_OF_QUARTER_FIELD;
|
|
3244
3226
|
}(Field);
|
|
3245
3227
|
var QUARTER_OF_YEAR_FIELD = function (_Field2) {
|
|
3246
|
-
_inheritsLoose(QUARTER_OF_YEAR_FIELD, _Field2);
|
|
3247
3228
|
function QUARTER_OF_YEAR_FIELD() {
|
|
3248
3229
|
return _Field2.apply(this, arguments) || this;
|
|
3249
3230
|
}
|
|
3231
|
+
_inheritsLoose(QUARTER_OF_YEAR_FIELD, _Field2);
|
|
3250
3232
|
var _proto3 = QUARTER_OF_YEAR_FIELD.prototype;
|
|
3251
3233
|
_proto3.toString = function toString() {
|
|
3252
3234
|
return 'QuarterOfYear';
|
|
@@ -3281,10 +3263,10 @@ var QUARTER_OF_YEAR_FIELD = function (_Field2) {
|
|
|
3281
3263
|
return QUARTER_OF_YEAR_FIELD;
|
|
3282
3264
|
}(Field);
|
|
3283
3265
|
var WEEK_OF_WEEK_BASED_YEAR_FIELD = function (_Field3) {
|
|
3284
|
-
_inheritsLoose(WEEK_OF_WEEK_BASED_YEAR_FIELD, _Field3);
|
|
3285
3266
|
function WEEK_OF_WEEK_BASED_YEAR_FIELD() {
|
|
3286
3267
|
return _Field3.apply(this, arguments) || this;
|
|
3287
3268
|
}
|
|
3269
|
+
_inheritsLoose(WEEK_OF_WEEK_BASED_YEAR_FIELD, _Field3);
|
|
3288
3270
|
var _proto4 = WEEK_OF_WEEK_BASED_YEAR_FIELD.prototype;
|
|
3289
3271
|
_proto4.toString = function toString() {
|
|
3290
3272
|
return 'WeekOfWeekBasedYear';
|
|
@@ -3359,10 +3341,10 @@ var WEEK_OF_WEEK_BASED_YEAR_FIELD = function (_Field3) {
|
|
|
3359
3341
|
return WEEK_OF_WEEK_BASED_YEAR_FIELD;
|
|
3360
3342
|
}(Field);
|
|
3361
3343
|
var WEEK_BASED_YEAR_FIELD = function (_Field4) {
|
|
3362
|
-
_inheritsLoose(WEEK_BASED_YEAR_FIELD, _Field4);
|
|
3363
3344
|
function WEEK_BASED_YEAR_FIELD() {
|
|
3364
3345
|
return _Field4.apply(this, arguments) || this;
|
|
3365
3346
|
}
|
|
3347
|
+
_inheritsLoose(WEEK_BASED_YEAR_FIELD, _Field4);
|
|
3366
3348
|
var _proto5 = WEEK_BASED_YEAR_FIELD.prototype;
|
|
3367
3349
|
_proto5.toString = function toString() {
|
|
3368
3350
|
return 'WeekBasedYear';
|
|
@@ -3407,7 +3389,6 @@ var WEEK_BASED_YEAR_FIELD = function (_Field4) {
|
|
|
3407
3389
|
return WEEK_BASED_YEAR_FIELD;
|
|
3408
3390
|
}(Field);
|
|
3409
3391
|
var Unit = function (_TemporalUnit) {
|
|
3410
|
-
_inheritsLoose(Unit, _TemporalUnit);
|
|
3411
3392
|
function Unit(name, estimatedDuration) {
|
|
3412
3393
|
var _this;
|
|
3413
3394
|
_this = _TemporalUnit.call(this) || this;
|
|
@@ -3415,6 +3396,7 @@ var Unit = function (_TemporalUnit) {
|
|
|
3415
3396
|
_this._duration = estimatedDuration;
|
|
3416
3397
|
return _this;
|
|
3417
3398
|
}
|
|
3399
|
+
_inheritsLoose(Unit, _TemporalUnit);
|
|
3418
3400
|
var _proto6 = Unit.prototype;
|
|
3419
3401
|
_proto6.duration = function duration() {
|
|
3420
3402
|
return this._duration;
|
|
@@ -3578,10 +3560,10 @@ var DecimalStyle = function () {
|
|
|
3578
3560
|
DecimalStyle.STANDARD = new DecimalStyle('0', '+', '-', '.');
|
|
3579
3561
|
|
|
3580
3562
|
var SignStyle = function (_Enum) {
|
|
3581
|
-
_inheritsLoose(SignStyle, _Enum);
|
|
3582
3563
|
function SignStyle() {
|
|
3583
3564
|
return _Enum.apply(this, arguments) || this;
|
|
3584
3565
|
}
|
|
3566
|
+
_inheritsLoose(SignStyle, _Enum);
|
|
3585
3567
|
var _proto = SignStyle.prototype;
|
|
3586
3568
|
_proto.parse = function parse(positive, strict, fixedWidth) {
|
|
3587
3569
|
switch (this) {
|
|
@@ -3603,10 +3585,10 @@ SignStyle.EXCEEDS_PAD = new SignStyle('EXCEEDS_PAD');
|
|
|
3603
3585
|
SignStyle.NOT_NEGATIVE = new SignStyle('NOT_NEGATIVE');
|
|
3604
3586
|
|
|
3605
3587
|
var TextStyle = function (_Enum) {
|
|
3606
|
-
_inheritsLoose(TextStyle, _Enum);
|
|
3607
3588
|
function TextStyle() {
|
|
3608
3589
|
return _Enum.apply(this, arguments) || this;
|
|
3609
3590
|
}
|
|
3591
|
+
_inheritsLoose(TextStyle, _Enum);
|
|
3610
3592
|
var _proto = TextStyle.prototype;
|
|
3611
3593
|
_proto.isStandalone = function isStandalone() {
|
|
3612
3594
|
switch (this) {
|
|
@@ -4067,7 +4049,6 @@ var NumberPrinterParser = function () {
|
|
|
4067
4049
|
return NumberPrinterParser;
|
|
4068
4050
|
}();
|
|
4069
4051
|
var ReducedPrinterParser = function (_NumberPrinterParser) {
|
|
4070
|
-
_inheritsLoose(ReducedPrinterParser, _NumberPrinterParser);
|
|
4071
4052
|
function ReducedPrinterParser(field, width, maxWidth, baseValue, baseDate) {
|
|
4072
4053
|
var _this;
|
|
4073
4054
|
_this = _NumberPrinterParser.call(this, field, width, maxWidth, SignStyle.NOT_NEGATIVE) || this;
|
|
@@ -4092,6 +4073,7 @@ var ReducedPrinterParser = function (_NumberPrinterParser) {
|
|
|
4092
4073
|
_this._baseDate = baseDate;
|
|
4093
4074
|
return _this;
|
|
4094
4075
|
}
|
|
4076
|
+
_inheritsLoose(ReducedPrinterParser, _NumberPrinterParser);
|
|
4095
4077
|
var _proto2 = ReducedPrinterParser.prototype;
|
|
4096
4078
|
_proto2._getValue = function _getValue(context, value) {
|
|
4097
4079
|
var absValue = Math.abs(value);
|
|
@@ -4328,10 +4310,10 @@ var PadPrinterParserDecorator = function () {
|
|
|
4328
4310
|
}();
|
|
4329
4311
|
|
|
4330
4312
|
var SettingsParser = function (_Enum) {
|
|
4331
|
-
_inheritsLoose(SettingsParser, _Enum);
|
|
4332
4313
|
function SettingsParser() {
|
|
4333
4314
|
return _Enum.apply(this, arguments) || this;
|
|
4334
4315
|
}
|
|
4316
|
+
_inheritsLoose(SettingsParser, _Enum);
|
|
4335
4317
|
var _proto = SettingsParser.prototype;
|
|
4336
4318
|
_proto.print = function print() {
|
|
4337
4319
|
return true;
|
|
@@ -4420,11 +4402,6 @@ var ZoneRulesProvider = function () {
|
|
|
4420
4402
|
}();
|
|
4421
4403
|
|
|
4422
4404
|
var ZoneRegion = function (_ZoneId) {
|
|
4423
|
-
_inheritsLoose(ZoneRegion, _ZoneId);
|
|
4424
|
-
ZoneRegion.ofId = function ofId(zoneId) {
|
|
4425
|
-
var rules = ZoneRulesProvider.getRules(zoneId);
|
|
4426
|
-
return new ZoneRegion(zoneId, rules);
|
|
4427
|
-
};
|
|
4428
4405
|
function ZoneRegion(id, rules) {
|
|
4429
4406
|
var _this;
|
|
4430
4407
|
_this = _ZoneId.call(this) || this;
|
|
@@ -4432,6 +4409,11 @@ var ZoneRegion = function (_ZoneId) {
|
|
|
4432
4409
|
_this._rules = rules;
|
|
4433
4410
|
return _this;
|
|
4434
4411
|
}
|
|
4412
|
+
_inheritsLoose(ZoneRegion, _ZoneId);
|
|
4413
|
+
ZoneRegion.ofId = function ofId(zoneId) {
|
|
4414
|
+
var rules = ZoneRulesProvider.getRules(zoneId);
|
|
4415
|
+
return new ZoneRegion(zoneId, rules);
|
|
4416
|
+
};
|
|
4435
4417
|
var _proto = ZoneRegion.prototype;
|
|
4436
4418
|
_proto.id = function id() {
|
|
4437
4419
|
return this._id;
|
|
@@ -4470,6 +4452,45 @@ var ZoneIdPrinterParser = function () {
|
|
|
4470
4452
|
if (position === length) {
|
|
4471
4453
|
return ~position;
|
|
4472
4454
|
}
|
|
4455
|
+
var region = this._parseRegion(text, position);
|
|
4456
|
+
var fixedEndPos = this._parseFixedId(context, text, position);
|
|
4457
|
+
var fixedLength = fixedEndPos >= 0 ? fixedEndPos - position : 0;
|
|
4458
|
+
if (region != null && region.parseLength > fixedLength) {
|
|
4459
|
+
context.setParsedZone(ZoneRegion.ofId(region.parsedZoneId));
|
|
4460
|
+
return position + region.parseLength;
|
|
4461
|
+
}
|
|
4462
|
+
return fixedEndPos;
|
|
4463
|
+
};
|
|
4464
|
+
_proto._parseRegion = function _parseRegion(text, position) {
|
|
4465
|
+
var availableZoneIds = ZoneRulesProvider.getAvailableZoneIds();
|
|
4466
|
+
if (availableZoneIds.length === 0) {
|
|
4467
|
+
return null;
|
|
4468
|
+
}
|
|
4469
|
+
if (zoneIdTree.size !== availableZoneIds.length) {
|
|
4470
|
+
zoneIdTree = ZoneIdTree.createTreeMap(availableZoneIds);
|
|
4471
|
+
}
|
|
4472
|
+
var maxParseLength = text.length - position;
|
|
4473
|
+
var treeMap = zoneIdTree.treeMap;
|
|
4474
|
+
var parsedZoneId = null;
|
|
4475
|
+
var parseLength = 0;
|
|
4476
|
+
while (treeMap != null) {
|
|
4477
|
+
var parsedSubZoneId = text.substr(position, Math.min(treeMap.length, maxParseLength));
|
|
4478
|
+
treeMap = treeMap.get(parsedSubZoneId);
|
|
4479
|
+
if (treeMap != null && treeMap.isLeaf) {
|
|
4480
|
+
parsedZoneId = parsedSubZoneId;
|
|
4481
|
+
parseLength = treeMap.length;
|
|
4482
|
+
}
|
|
4483
|
+
}
|
|
4484
|
+
if (parsedZoneId == null) {
|
|
4485
|
+
return null;
|
|
4486
|
+
}
|
|
4487
|
+
return {
|
|
4488
|
+
parsedZoneId: parsedZoneId,
|
|
4489
|
+
parseLength: parseLength
|
|
4490
|
+
};
|
|
4491
|
+
};
|
|
4492
|
+
_proto._parseFixedId = function _parseFixedId(context, text, position) {
|
|
4493
|
+
var length = text.length;
|
|
4473
4494
|
var nextChar = text.charAt(position);
|
|
4474
4495
|
if (nextChar === '+' || nextChar === '-') {
|
|
4475
4496
|
var newContext = context.copy();
|
|
@@ -4478,8 +4499,7 @@ var ZoneIdPrinterParser = function () {
|
|
|
4478
4499
|
return endPos;
|
|
4479
4500
|
}
|
|
4480
4501
|
var offset = newContext.getParsed(ChronoField.OFFSET_SECONDS);
|
|
4481
|
-
|
|
4482
|
-
context.setParsedZone(zone);
|
|
4502
|
+
context.setParsedZone(ZoneOffset.ofTotalSeconds(offset));
|
|
4483
4503
|
return endPos;
|
|
4484
4504
|
} else if (length >= position + 2) {
|
|
4485
4505
|
var nextNextChar = text.charAt(position + 1);
|
|
@@ -4500,26 +4520,6 @@ var ZoneIdPrinterParser = function () {
|
|
|
4500
4520
|
context.setParsedZone(ZoneOffset.UTC);
|
|
4501
4521
|
return position + 1;
|
|
4502
4522
|
}
|
|
4503
|
-
var availableZoneIds = ZoneRulesProvider.getAvailableZoneIds();
|
|
4504
|
-
if (zoneIdTree.size !== availableZoneIds.length) {
|
|
4505
|
-
zoneIdTree = ZoneIdTree.createTreeMap(availableZoneIds);
|
|
4506
|
-
}
|
|
4507
|
-
var maxParseLength = length - position;
|
|
4508
|
-
var treeMap = zoneIdTree.treeMap;
|
|
4509
|
-
var parsedZoneId = null;
|
|
4510
|
-
var parseLength = 0;
|
|
4511
|
-
while (treeMap != null) {
|
|
4512
|
-
var parsedSubZoneId = text.substr(position, Math.min(treeMap.length, maxParseLength));
|
|
4513
|
-
treeMap = treeMap.get(parsedSubZoneId);
|
|
4514
|
-
if (treeMap != null && treeMap.isLeaf) {
|
|
4515
|
-
parsedZoneId = parsedSubZoneId;
|
|
4516
|
-
parseLength = treeMap.length;
|
|
4517
|
-
}
|
|
4518
|
-
}
|
|
4519
|
-
if (parsedZoneId != null) {
|
|
4520
|
-
context.setParsedZone(ZoneRegion.ofId(parsedZoneId));
|
|
4521
|
-
return position + parseLength;
|
|
4522
|
-
}
|
|
4523
4523
|
return ~position;
|
|
4524
4524
|
};
|
|
4525
4525
|
_proto._parsePrefixedOffset = function _parsePrefixedOffset(context, text, prefixPos, position) {
|
|
@@ -4545,6 +4545,10 @@ var ZoneIdPrinterParser = function () {
|
|
|
4545
4545
|
return ZoneIdPrinterParser;
|
|
4546
4546
|
}();
|
|
4547
4547
|
var ZoneIdTree = function () {
|
|
4548
|
+
function ZoneIdTree(size, treeMap) {
|
|
4549
|
+
this.size = size;
|
|
4550
|
+
this.treeMap = treeMap;
|
|
4551
|
+
}
|
|
4548
4552
|
ZoneIdTree.createTreeMap = function createTreeMap(availableZoneIds) {
|
|
4549
4553
|
var sortedZoneIds = availableZoneIds.sort(function (a, b) {
|
|
4550
4554
|
return a.length - b.length;
|
|
@@ -4555,10 +4559,6 @@ var ZoneIdTree = function () {
|
|
|
4555
4559
|
}
|
|
4556
4560
|
return new ZoneIdTree(sortedZoneIds.length, treeMap);
|
|
4557
4561
|
};
|
|
4558
|
-
function ZoneIdTree(size, treeMap) {
|
|
4559
|
-
this.size = size;
|
|
4560
|
-
this.treeMap = treeMap;
|
|
4561
|
-
}
|
|
4562
4562
|
return ZoneIdTree;
|
|
4563
4563
|
}();
|
|
4564
4564
|
var ZoneIdTreeMap = function () {
|
|
@@ -5243,7 +5243,7 @@ var InstantPrinterParser = function () {
|
|
|
5243
5243
|
var newContext = context.copy();
|
|
5244
5244
|
var minDigits = this.fractionalDigits < 0 ? 0 : this.fractionalDigits;
|
|
5245
5245
|
var maxDigits = this.fractionalDigits < 0 ? 9 : this.fractionalDigits;
|
|
5246
|
-
var parser = new DateTimeFormatterBuilder().append(DateTimeFormatter.ISO_LOCAL_DATE).appendLiteral('T').appendValue(ChronoField.HOUR_OF_DAY, 2).appendLiteral(':').appendValue(ChronoField.MINUTE_OF_HOUR, 2).appendLiteral(':').appendValue(ChronoField.SECOND_OF_MINUTE, 2).appendFraction(ChronoField.NANO_OF_SECOND, minDigits, maxDigits, true).
|
|
5246
|
+
var parser = new DateTimeFormatterBuilder().append(DateTimeFormatter.ISO_LOCAL_DATE).appendLiteral('T').appendValue(ChronoField.HOUR_OF_DAY, 2).appendLiteral(':').appendValue(ChronoField.MINUTE_OF_HOUR, 2).appendLiteral(':').appendValue(ChronoField.SECOND_OF_MINUTE, 2).appendFraction(ChronoField.NANO_OF_SECOND, minDigits, maxDigits, true).appendOffsetId().toFormatter()._toPrinterParser(false);
|
|
5247
5247
|
var pos = parser.parse(newContext, text, position);
|
|
5248
5248
|
if (pos < 0) {
|
|
5249
5249
|
return pos;
|
|
@@ -5255,6 +5255,8 @@ var InstantPrinterParser = function () {
|
|
|
5255
5255
|
var min = newContext.getParsed(ChronoField.MINUTE_OF_HOUR);
|
|
5256
5256
|
var secVal = newContext.getParsed(ChronoField.SECOND_OF_MINUTE);
|
|
5257
5257
|
var nanoVal = newContext.getParsed(ChronoField.NANO_OF_SECOND);
|
|
5258
|
+
var offsetSecs = newContext.getParsed(ChronoField.OFFSET_SECONDS);
|
|
5259
|
+
var offset = offsetSecs != null ? offsetSecs : 0;
|
|
5258
5260
|
var sec = secVal != null ? secVal : 0;
|
|
5259
5261
|
var nano = nanoVal != null ? nanoVal : 0;
|
|
5260
5262
|
var year = MathUtil.intMod(yearParsed, 10000);
|
|
@@ -5269,7 +5271,7 @@ var InstantPrinterParser = function () {
|
|
|
5269
5271
|
var instantSecs;
|
|
5270
5272
|
try {
|
|
5271
5273
|
var ldt = LocalDateTime.of(year, month, day, hour, min, sec, 0).plusDays(days);
|
|
5272
|
-
instantSecs = ldt.toEpochSecond(ZoneOffset.
|
|
5274
|
+
instantSecs = ldt.toEpochSecond(ZoneOffset.ofTotalSeconds(offset));
|
|
5273
5275
|
instantSecs += MathUtil.safeMultiply(MathUtil.intDiv(yearParsed, 10000), SECONDS_PER_10000_YEARS);
|
|
5274
5276
|
} catch (ex) {
|
|
5275
5277
|
return ~position;
|
|
@@ -5359,15 +5361,6 @@ function _init$e() {
|
|
|
5359
5361
|
*/
|
|
5360
5362
|
|
|
5361
5363
|
var DateTimeFormatter = function () {
|
|
5362
|
-
DateTimeFormatter.parsedExcessDays = function parsedExcessDays() {
|
|
5363
|
-
return DateTimeFormatter.PARSED_EXCESS_DAYS;
|
|
5364
|
-
};
|
|
5365
|
-
DateTimeFormatter.parsedLeapSecond = function parsedLeapSecond() {
|
|
5366
|
-
return DateTimeFormatter.PARSED_LEAP_SECOND;
|
|
5367
|
-
};
|
|
5368
|
-
DateTimeFormatter.ofPattern = function ofPattern(pattern) {
|
|
5369
|
-
return new DateTimeFormatterBuilder().appendPattern(pattern).toFormatter();
|
|
5370
|
-
};
|
|
5371
5364
|
function DateTimeFormatter(printerParser, locale, decimalStyle, resolverStyle, resolverFields, chrono, zone) {
|
|
5372
5365
|
if (chrono === void 0) {
|
|
5373
5366
|
chrono = IsoChronology.INSTANCE;
|
|
@@ -5383,6 +5376,15 @@ var DateTimeFormatter = function () {
|
|
|
5383
5376
|
this._chrono = chrono;
|
|
5384
5377
|
this._zone = zone;
|
|
5385
5378
|
}
|
|
5379
|
+
DateTimeFormatter.parsedExcessDays = function parsedExcessDays() {
|
|
5380
|
+
return DateTimeFormatter.PARSED_EXCESS_DAYS;
|
|
5381
|
+
};
|
|
5382
|
+
DateTimeFormatter.parsedLeapSecond = function parsedLeapSecond() {
|
|
5383
|
+
return DateTimeFormatter.PARSED_LEAP_SECOND;
|
|
5384
|
+
};
|
|
5385
|
+
DateTimeFormatter.ofPattern = function ofPattern(pattern) {
|
|
5386
|
+
return new DateTimeFormatterBuilder().appendPattern(pattern).toFormatter();
|
|
5387
|
+
};
|
|
5386
5388
|
var _proto = DateTimeFormatter.prototype;
|
|
5387
5389
|
_proto.locale = function locale() {
|
|
5388
5390
|
return this._locale;
|
|
@@ -5537,6 +5539,13 @@ function _init$d() {
|
|
|
5537
5539
|
}
|
|
5538
5540
|
|
|
5539
5541
|
var MonthDay = function (_TemporalAccessor) {
|
|
5542
|
+
function MonthDay(month, dayOfMonth) {
|
|
5543
|
+
var _this;
|
|
5544
|
+
_this = _TemporalAccessor.call(this) || this;
|
|
5545
|
+
_this._month = MathUtil.safeToInt(month);
|
|
5546
|
+
_this._day = MathUtil.safeToInt(dayOfMonth);
|
|
5547
|
+
return _this;
|
|
5548
|
+
}
|
|
5540
5549
|
_inheritsLoose(MonthDay, _TemporalAccessor);
|
|
5541
5550
|
MonthDay.now = function now(zoneIdOrClock) {
|
|
5542
5551
|
if (arguments.length === 0) {
|
|
@@ -5607,13 +5616,6 @@ var MonthDay = function (_TemporalAccessor) {
|
|
|
5607
5616
|
requireInstance(formatter, DateTimeFormatter, 'formatter');
|
|
5608
5617
|
return formatter.parse(text, MonthDay.FROM);
|
|
5609
5618
|
};
|
|
5610
|
-
function MonthDay(month, dayOfMonth) {
|
|
5611
|
-
var _this;
|
|
5612
|
-
_this = _TemporalAccessor.call(this) || this;
|
|
5613
|
-
_this._month = MathUtil.safeToInt(month);
|
|
5614
|
-
_this._day = MathUtil.safeToInt(dayOfMonth);
|
|
5615
|
-
return _this;
|
|
5616
|
-
}
|
|
5617
5619
|
var _proto = MonthDay.prototype;
|
|
5618
5620
|
_proto.monthValue = function monthValue() {
|
|
5619
5621
|
return this._month;
|
|
@@ -5741,6 +5743,13 @@ function _init$c() {
|
|
|
5741
5743
|
}
|
|
5742
5744
|
|
|
5743
5745
|
var YearMonth = function (_Temporal) {
|
|
5746
|
+
function YearMonth(year, month) {
|
|
5747
|
+
var _this;
|
|
5748
|
+
_this = _Temporal.call(this) || this;
|
|
5749
|
+
_this._year = MathUtil.safeToInt(year);
|
|
5750
|
+
_this._month = MathUtil.safeToInt(month);
|
|
5751
|
+
return _this;
|
|
5752
|
+
}
|
|
5744
5753
|
_inheritsLoose(YearMonth, _Temporal);
|
|
5745
5754
|
YearMonth.now = function now(zoneIdOrClock) {
|
|
5746
5755
|
if (arguments.length === 0) {
|
|
@@ -5805,13 +5814,6 @@ var YearMonth = function (_Temporal) {
|
|
|
5805
5814
|
requireNonNull(formatter, 'formatter');
|
|
5806
5815
|
return formatter.parse(text, YearMonth.FROM);
|
|
5807
5816
|
};
|
|
5808
|
-
function YearMonth(year, month) {
|
|
5809
|
-
var _this;
|
|
5810
|
-
_this = _Temporal.call(this) || this;
|
|
5811
|
-
_this._year = MathUtil.safeToInt(year);
|
|
5812
|
-
_this._month = MathUtil.safeToInt(month);
|
|
5813
|
-
return _this;
|
|
5814
|
-
}
|
|
5815
5817
|
var _proto = YearMonth.prototype;
|
|
5816
5818
|
_proto.isSupported = function isSupported(fieldOrUnit) {
|
|
5817
5819
|
if (arguments.length === 1 && fieldOrUnit instanceof TemporalField) {
|
|
@@ -6065,13 +6067,13 @@ function _init$b() {
|
|
|
6065
6067
|
}
|
|
6066
6068
|
|
|
6067
6069
|
var Year = function (_Temporal) {
|
|
6068
|
-
_inheritsLoose(Year, _Temporal);
|
|
6069
6070
|
function Year(value) {
|
|
6070
6071
|
var _this;
|
|
6071
6072
|
_this = _Temporal.call(this) || this;
|
|
6072
6073
|
_this._year = MathUtil.safeToInt(value);
|
|
6073
6074
|
return _this;
|
|
6074
6075
|
}
|
|
6076
|
+
_inheritsLoose(Year, _Temporal);
|
|
6075
6077
|
var _proto = Year.prototype;
|
|
6076
6078
|
_proto.value = function value() {
|
|
6077
6079
|
return this._year;
|
|
@@ -6412,13 +6414,13 @@ var TemporalAdjusters = function () {
|
|
|
6412
6414
|
return TemporalAdjusters;
|
|
6413
6415
|
}();
|
|
6414
6416
|
var Impl = function (_TemporalAdjuster) {
|
|
6415
|
-
_inheritsLoose(Impl, _TemporalAdjuster);
|
|
6416
6417
|
function Impl(ordinal) {
|
|
6417
6418
|
var _this;
|
|
6418
6419
|
_this = _TemporalAdjuster.call(this) || this;
|
|
6419
6420
|
_this._ordinal = ordinal;
|
|
6420
6421
|
return _this;
|
|
6421
6422
|
}
|
|
6423
|
+
_inheritsLoose(Impl, _TemporalAdjuster);
|
|
6422
6424
|
var _proto = Impl.prototype;
|
|
6423
6425
|
_proto.adjustInto = function adjustInto(temporal) {
|
|
6424
6426
|
switch (this._ordinal) {
|
|
@@ -6446,7 +6448,6 @@ Impl.FIRST_DAY_OF_YEAR = new Impl(3);
|
|
|
6446
6448
|
Impl.LAST_DAY_OF_YEAR = new Impl(4);
|
|
6447
6449
|
Impl.FIRST_DAY_OF_NEXT_YEAR = new Impl(5);
|
|
6448
6450
|
var DayOfWeekInMonth = function (_TemporalAdjuster2) {
|
|
6449
|
-
_inheritsLoose(DayOfWeekInMonth, _TemporalAdjuster2);
|
|
6450
6451
|
function DayOfWeekInMonth(ordinal, dow) {
|
|
6451
6452
|
var _this2;
|
|
6452
6453
|
_this2 = _TemporalAdjuster2.call(this) || this;
|
|
@@ -6454,6 +6455,7 @@ var DayOfWeekInMonth = function (_TemporalAdjuster2) {
|
|
|
6454
6455
|
_this2._dowValue = dow.value();
|
|
6455
6456
|
return _this2;
|
|
6456
6457
|
}
|
|
6458
|
+
_inheritsLoose(DayOfWeekInMonth, _TemporalAdjuster2);
|
|
6457
6459
|
var _proto2 = DayOfWeekInMonth.prototype;
|
|
6458
6460
|
_proto2.adjustInto = function adjustInto(temporal) {
|
|
6459
6461
|
if (this._ordinal >= 0) {
|
|
@@ -6474,7 +6476,6 @@ var DayOfWeekInMonth = function (_TemporalAdjuster2) {
|
|
|
6474
6476
|
return DayOfWeekInMonth;
|
|
6475
6477
|
}(TemporalAdjuster);
|
|
6476
6478
|
var RelativeDayOfWeek = function (_TemporalAdjuster3) {
|
|
6477
|
-
_inheritsLoose(RelativeDayOfWeek, _TemporalAdjuster3);
|
|
6478
6479
|
function RelativeDayOfWeek(relative, dayOfWeek) {
|
|
6479
6480
|
var _this3;
|
|
6480
6481
|
_this3 = _TemporalAdjuster3.call(this) || this;
|
|
@@ -6483,6 +6484,7 @@ var RelativeDayOfWeek = function (_TemporalAdjuster3) {
|
|
|
6483
6484
|
_this3._dowValue = dayOfWeek.value();
|
|
6484
6485
|
return _this3;
|
|
6485
6486
|
}
|
|
6487
|
+
_inheritsLoose(RelativeDayOfWeek, _TemporalAdjuster3);
|
|
6486
6488
|
var _proto3 = RelativeDayOfWeek.prototype;
|
|
6487
6489
|
_proto3.adjustInto = function adjustInto(temporal) {
|
|
6488
6490
|
var calDow = temporal.get(ChronoField.DAY_OF_WEEK);
|
|
@@ -6501,10 +6503,10 @@ var RelativeDayOfWeek = function (_TemporalAdjuster3) {
|
|
|
6501
6503
|
}(TemporalAdjuster);
|
|
6502
6504
|
|
|
6503
6505
|
var IsoChronology = function (_Enum) {
|
|
6504
|
-
_inheritsLoose(IsoChronology, _Enum);
|
|
6505
6506
|
function IsoChronology() {
|
|
6506
6507
|
return _Enum.apply(this, arguments) || this;
|
|
6507
6508
|
}
|
|
6509
|
+
_inheritsLoose(IsoChronology, _Enum);
|
|
6508
6510
|
IsoChronology.isLeapYear = function isLeapYear(prolepticYear) {
|
|
6509
6511
|
return (prolepticYear & 3) === 0 && (prolepticYear % 100 !== 0 || prolepticYear % 400 === 0);
|
|
6510
6512
|
};
|
|
@@ -6634,6 +6636,17 @@ function _init$9() {
|
|
|
6634
6636
|
}
|
|
6635
6637
|
|
|
6636
6638
|
var OffsetTime = function (_Temporal) {
|
|
6639
|
+
function OffsetTime(time, offset) {
|
|
6640
|
+
var _this;
|
|
6641
|
+
_this = _Temporal.call(this) || this;
|
|
6642
|
+
requireNonNull(time, 'time');
|
|
6643
|
+
requireInstance(time, LocalTime, 'time');
|
|
6644
|
+
requireNonNull(offset, 'offset');
|
|
6645
|
+
requireInstance(offset, ZoneOffset, 'offset');
|
|
6646
|
+
_this._time = time;
|
|
6647
|
+
_this._offset = offset;
|
|
6648
|
+
return _this;
|
|
6649
|
+
}
|
|
6637
6650
|
_inheritsLoose(OffsetTime, _Temporal);
|
|
6638
6651
|
OffsetTime.from = function from(temporal) {
|
|
6639
6652
|
requireNonNull(temporal, 'temporal');
|
|
@@ -6700,17 +6713,6 @@ var OffsetTime = function (_Temporal) {
|
|
|
6700
6713
|
requireNonNull(formatter, 'formatter');
|
|
6701
6714
|
return formatter.parse(text, OffsetTime.FROM);
|
|
6702
6715
|
};
|
|
6703
|
-
function OffsetTime(time, offset) {
|
|
6704
|
-
var _this;
|
|
6705
|
-
_this = _Temporal.call(this) || this;
|
|
6706
|
-
requireNonNull(time, 'time');
|
|
6707
|
-
requireInstance(time, LocalTime, 'time');
|
|
6708
|
-
requireNonNull(offset, 'offset');
|
|
6709
|
-
requireInstance(offset, ZoneOffset, 'offset');
|
|
6710
|
-
_this._time = time;
|
|
6711
|
-
_this._offset = offset;
|
|
6712
|
-
return _this;
|
|
6713
|
-
}
|
|
6714
6716
|
var _proto = OffsetTime.prototype;
|
|
6715
6717
|
_proto.adjustInto = function adjustInto(temporal) {
|
|
6716
6718
|
return temporal.with(ChronoField.NANO_OF_DAY, this._time.toNanoOfDay()).with(ChronoField.OFFSET_SECONDS, this.offset().totalSeconds());
|
|
@@ -6961,10 +6963,10 @@ function _init$8() {
|
|
|
6961
6963
|
}
|
|
6962
6964
|
|
|
6963
6965
|
var ChronoZonedDateTime = function (_Temporal) {
|
|
6964
|
-
_inheritsLoose(ChronoZonedDateTime, _Temporal);
|
|
6965
6966
|
function ChronoZonedDateTime() {
|
|
6966
6967
|
return _Temporal.apply(this, arguments) || this;
|
|
6967
6968
|
}
|
|
6969
|
+
_inheritsLoose(ChronoZonedDateTime, _Temporal);
|
|
6968
6970
|
var _proto = ChronoZonedDateTime.prototype;
|
|
6969
6971
|
_proto.query = function query(_query) {
|
|
6970
6972
|
if (_query === TemporalQueries.zoneId() || _query === TemporalQueries.zone()) {
|
|
@@ -7047,6 +7049,17 @@ function strcmp(a, b) {
|
|
|
7047
7049
|
}
|
|
7048
7050
|
|
|
7049
7051
|
var ZonedDateTime = function (_ChronoZonedDateTime) {
|
|
7052
|
+
function ZonedDateTime(dateTime, offset, zone) {
|
|
7053
|
+
var _this;
|
|
7054
|
+
requireNonNull(dateTime, 'dateTime');
|
|
7055
|
+
requireNonNull(offset, 'offset');
|
|
7056
|
+
requireNonNull(zone, 'zone');
|
|
7057
|
+
_this = _ChronoZonedDateTime.call(this) || this;
|
|
7058
|
+
_this._dateTime = dateTime;
|
|
7059
|
+
_this._offset = offset;
|
|
7060
|
+
_this._zone = zone;
|
|
7061
|
+
return _this;
|
|
7062
|
+
}
|
|
7050
7063
|
_inheritsLoose(ZonedDateTime, _ChronoZonedDateTime);
|
|
7051
7064
|
ZonedDateTime.now = function now(clockOrZone) {
|
|
7052
7065
|
var clock;
|
|
@@ -7182,17 +7195,6 @@ var ZonedDateTime = function (_ChronoZonedDateTime) {
|
|
|
7182
7195
|
requireNonNull(formatter, 'formatter');
|
|
7183
7196
|
return formatter.parse(text, ZonedDateTime.FROM);
|
|
7184
7197
|
};
|
|
7185
|
-
function ZonedDateTime(dateTime, offset, zone) {
|
|
7186
|
-
var _this;
|
|
7187
|
-
requireNonNull(dateTime, 'dateTime');
|
|
7188
|
-
requireNonNull(offset, 'offset');
|
|
7189
|
-
requireNonNull(zone, 'zone');
|
|
7190
|
-
_this = _ChronoZonedDateTime.call(this) || this;
|
|
7191
|
-
_this._dateTime = dateTime;
|
|
7192
|
-
_this._offset = offset;
|
|
7193
|
-
_this._zone = zone;
|
|
7194
|
-
return _this;
|
|
7195
|
-
}
|
|
7196
7198
|
var _proto = ZonedDateTime.prototype;
|
|
7197
7199
|
_proto._resolveLocal = function _resolveLocal(newDateTime) {
|
|
7198
7200
|
requireNonNull(newDateTime, 'newDateTime');
|
|
@@ -7493,6 +7495,17 @@ function _init$7() {
|
|
|
7493
7495
|
}
|
|
7494
7496
|
|
|
7495
7497
|
var OffsetDateTime = function (_Temporal) {
|
|
7498
|
+
function OffsetDateTime(dateTime, offset) {
|
|
7499
|
+
var _this;
|
|
7500
|
+
_this = _Temporal.call(this) || this;
|
|
7501
|
+
requireNonNull(dateTime, 'dateTime');
|
|
7502
|
+
requireInstance(dateTime, LocalDateTime, 'dateTime');
|
|
7503
|
+
requireNonNull(offset, 'offset');
|
|
7504
|
+
requireInstance(offset, ZoneOffset, 'offset');
|
|
7505
|
+
_this._dateTime = dateTime;
|
|
7506
|
+
_this._offset = offset;
|
|
7507
|
+
return _this;
|
|
7508
|
+
}
|
|
7496
7509
|
_inheritsLoose(OffsetDateTime, _Temporal);
|
|
7497
7510
|
OffsetDateTime.from = function from(temporal) {
|
|
7498
7511
|
requireNonNull(temporal, 'temporal');
|
|
@@ -7520,8 +7533,8 @@ var OffsetDateTime = function (_Temporal) {
|
|
|
7520
7533
|
if (clockOrZone instanceof ZoneId) {
|
|
7521
7534
|
return OffsetDateTime.now(Clock.system(clockOrZone));
|
|
7522
7535
|
} else if (clockOrZone instanceof Clock) {
|
|
7523
|
-
var
|
|
7524
|
-
return OffsetDateTime.ofInstant(
|
|
7536
|
+
var _now = clockOrZone.instant();
|
|
7537
|
+
return OffsetDateTime.ofInstant(_now, clockOrZone.zone().rules().offset(_now));
|
|
7525
7538
|
} else {
|
|
7526
7539
|
throw new IllegalArgumentException('clockOrZone must be an instance of ZoneId or Clock');
|
|
7527
7540
|
}
|
|
@@ -7574,17 +7587,6 @@ var OffsetDateTime = function (_Temporal) {
|
|
|
7574
7587
|
requireNonNull(formatter, 'formatter');
|
|
7575
7588
|
return formatter.parse(text, OffsetDateTime.FROM);
|
|
7576
7589
|
};
|
|
7577
|
-
function OffsetDateTime(dateTime, offset) {
|
|
7578
|
-
var _this;
|
|
7579
|
-
_this = _Temporal.call(this) || this;
|
|
7580
|
-
requireNonNull(dateTime, 'dateTime');
|
|
7581
|
-
requireInstance(dateTime, LocalDateTime, 'dateTime');
|
|
7582
|
-
requireNonNull(offset, 'offset');
|
|
7583
|
-
requireInstance(offset, ZoneOffset, 'offset');
|
|
7584
|
-
_this._dateTime = dateTime;
|
|
7585
|
-
_this._offset = offset;
|
|
7586
|
-
return _this;
|
|
7587
|
-
}
|
|
7588
7590
|
var _proto = OffsetDateTime.prototype;
|
|
7589
7591
|
_proto.adjustInto = function adjustInto(temporal) {
|
|
7590
7592
|
return temporal.with(ChronoField.EPOCH_DAY, this.toLocalDate().toEpochDay()).with(ChronoField.NANO_OF_DAY, this.toLocalTime().toNanoOfDay()).with(ChronoField.OFFSET_SECONDS, this.offset().totalSeconds());
|
|
@@ -7922,6 +7924,21 @@ function _init$6() {
|
|
|
7922
7924
|
var DAYS_PER_CYCLE = 146097;
|
|
7923
7925
|
var DAYS_0000_TO_1970 = DAYS_PER_CYCLE * 5 - (30 * 365 + 7);
|
|
7924
7926
|
var LocalDate = function (_ChronoLocalDate) {
|
|
7927
|
+
function LocalDate(year, month, dayOfMonth) {
|
|
7928
|
+
var _this;
|
|
7929
|
+
_this = _ChronoLocalDate.call(this) || this;
|
|
7930
|
+
requireNonNull(year, 'year');
|
|
7931
|
+
requireNonNull(month, 'month');
|
|
7932
|
+
requireNonNull(dayOfMonth, 'dayOfMonth');
|
|
7933
|
+
if (month instanceof Month) {
|
|
7934
|
+
month = month.value();
|
|
7935
|
+
}
|
|
7936
|
+
_this._year = MathUtil.safeToInt(year);
|
|
7937
|
+
_this._month = MathUtil.safeToInt(month);
|
|
7938
|
+
_this._day = MathUtil.safeToInt(dayOfMonth);
|
|
7939
|
+
LocalDate._validate(_this._year, _this._month, _this._day);
|
|
7940
|
+
return _this;
|
|
7941
|
+
}
|
|
7925
7942
|
_inheritsLoose(LocalDate, _ChronoLocalDate);
|
|
7926
7943
|
LocalDate.now = function now(clockOrZone) {
|
|
7927
7944
|
var clock;
|
|
@@ -8018,21 +8035,6 @@ var LocalDate = function (_ChronoLocalDate) {
|
|
|
8018
8035
|
}
|
|
8019
8036
|
return LocalDate.of(year, month, day);
|
|
8020
8037
|
};
|
|
8021
|
-
function LocalDate(year, month, dayOfMonth) {
|
|
8022
|
-
var _this;
|
|
8023
|
-
_this = _ChronoLocalDate.call(this) || this;
|
|
8024
|
-
requireNonNull(year, 'year');
|
|
8025
|
-
requireNonNull(month, 'month');
|
|
8026
|
-
requireNonNull(dayOfMonth, 'dayOfMonth');
|
|
8027
|
-
if (month instanceof Month) {
|
|
8028
|
-
month = month.value();
|
|
8029
|
-
}
|
|
8030
|
-
_this._year = MathUtil.safeToInt(year);
|
|
8031
|
-
_this._month = MathUtil.safeToInt(month);
|
|
8032
|
-
_this._day = MathUtil.safeToInt(dayOfMonth);
|
|
8033
|
-
LocalDate._validate(_this._year, _this._month, _this._day);
|
|
8034
|
-
return _this;
|
|
8035
|
-
}
|
|
8036
8038
|
LocalDate._validate = function _validate(year, month, dayOfMonth) {
|
|
8037
8039
|
var dom;
|
|
8038
8040
|
ChronoField.YEAR.checkValidValue(year);
|
|
@@ -8531,10 +8533,10 @@ function _init$5() {
|
|
|
8531
8533
|
}
|
|
8532
8534
|
|
|
8533
8535
|
var ChronoLocalDateTime = function (_Temporal) {
|
|
8534
|
-
_inheritsLoose(ChronoLocalDateTime, _Temporal);
|
|
8535
8536
|
function ChronoLocalDateTime() {
|
|
8536
8537
|
return _Temporal.apply(this, arguments) || this;
|
|
8537
8538
|
}
|
|
8539
|
+
_inheritsLoose(ChronoLocalDateTime, _Temporal);
|
|
8538
8540
|
var _proto = ChronoLocalDateTime.prototype;
|
|
8539
8541
|
_proto.chronology = function chronology() {
|
|
8540
8542
|
return this.toLocalDate().chronology();
|
|
@@ -8571,6 +8573,15 @@ var ChronoLocalDateTime = function (_Temporal) {
|
|
|
8571
8573
|
}(Temporal);
|
|
8572
8574
|
|
|
8573
8575
|
var LocalDateTime = function (_ChronoLocalDateTime) {
|
|
8576
|
+
function LocalDateTime(date, time) {
|
|
8577
|
+
var _this;
|
|
8578
|
+
_this = _ChronoLocalDateTime.call(this) || this;
|
|
8579
|
+
requireInstance(date, LocalDate, 'date');
|
|
8580
|
+
requireInstance(time, LocalTime, 'time');
|
|
8581
|
+
_this._date = date;
|
|
8582
|
+
_this._time = time;
|
|
8583
|
+
return _this;
|
|
8584
|
+
}
|
|
8574
8585
|
_inheritsLoose(LocalDateTime, _ChronoLocalDateTime);
|
|
8575
8586
|
LocalDateTime.now = function now(clockOrZone) {
|
|
8576
8587
|
if (clockOrZone == null) {
|
|
@@ -8674,15 +8685,6 @@ var LocalDateTime = function (_ChronoLocalDateTime) {
|
|
|
8674
8685
|
requireNonNull(formatter, 'formatter');
|
|
8675
8686
|
return formatter.parse(text, LocalDateTime.FROM);
|
|
8676
8687
|
};
|
|
8677
|
-
function LocalDateTime(date, time) {
|
|
8678
|
-
var _this;
|
|
8679
|
-
_this = _ChronoLocalDateTime.call(this) || this;
|
|
8680
|
-
requireInstance(date, LocalDate, 'date');
|
|
8681
|
-
requireInstance(time, LocalTime, 'time');
|
|
8682
|
-
_this._date = date;
|
|
8683
|
-
_this._time = time;
|
|
8684
|
-
return _this;
|
|
8685
|
-
}
|
|
8686
8688
|
var _proto = LocalDateTime.prototype;
|
|
8687
8689
|
_proto._withDateTime = function _withDateTime(newDate, newTime) {
|
|
8688
8690
|
if (this._date.equals(newDate) && this._time.equals(newTime)) {
|
|
@@ -9021,6 +9023,42 @@ function _init$4() {
|
|
|
9021
9023
|
}
|
|
9022
9024
|
|
|
9023
9025
|
var LocalTime = function (_Temporal) {
|
|
9026
|
+
function LocalTime(hour, minute, second, nanoOfSecond) {
|
|
9027
|
+
var _this;
|
|
9028
|
+
if (hour === void 0) {
|
|
9029
|
+
hour = 0;
|
|
9030
|
+
}
|
|
9031
|
+
if (minute === void 0) {
|
|
9032
|
+
minute = 0;
|
|
9033
|
+
}
|
|
9034
|
+
if (second === void 0) {
|
|
9035
|
+
second = 0;
|
|
9036
|
+
}
|
|
9037
|
+
if (nanoOfSecond === void 0) {
|
|
9038
|
+
nanoOfSecond = 0;
|
|
9039
|
+
}
|
|
9040
|
+
_this = _Temporal.call(this) || this;
|
|
9041
|
+
var _hour = MathUtil.safeToInt(hour);
|
|
9042
|
+
var _minute = MathUtil.safeToInt(minute);
|
|
9043
|
+
var _second = MathUtil.safeToInt(second);
|
|
9044
|
+
var _nanoOfSecond = MathUtil.safeToInt(nanoOfSecond);
|
|
9045
|
+
LocalTime._validate(_hour, _minute, _second, _nanoOfSecond);
|
|
9046
|
+
if (_minute === 0 && _second === 0 && _nanoOfSecond === 0) {
|
|
9047
|
+
if (!LocalTime.HOURS[_hour]) {
|
|
9048
|
+
_this._hour = _hour;
|
|
9049
|
+
_this._minute = _minute;
|
|
9050
|
+
_this._second = _second;
|
|
9051
|
+
_this._nano = _nanoOfSecond;
|
|
9052
|
+
LocalTime.HOURS[_hour] = _this;
|
|
9053
|
+
}
|
|
9054
|
+
return LocalTime.HOURS[_hour] || _assertThisInitialized(_this);
|
|
9055
|
+
}
|
|
9056
|
+
_this._hour = _hour;
|
|
9057
|
+
_this._minute = _minute;
|
|
9058
|
+
_this._second = _second;
|
|
9059
|
+
_this._nano = _nanoOfSecond;
|
|
9060
|
+
return _this;
|
|
9061
|
+
}
|
|
9024
9062
|
_inheritsLoose(LocalTime, _Temporal);
|
|
9025
9063
|
LocalTime.now = function now(clockOrZone) {
|
|
9026
9064
|
if (clockOrZone == null) {
|
|
@@ -9096,42 +9134,6 @@ var LocalTime = function (_Temporal) {
|
|
|
9096
9134
|
requireNonNull(formatter, 'formatter');
|
|
9097
9135
|
return formatter.parse(text, LocalTime.FROM);
|
|
9098
9136
|
};
|
|
9099
|
-
function LocalTime(hour, minute, second, nanoOfSecond) {
|
|
9100
|
-
var _this;
|
|
9101
|
-
if (hour === void 0) {
|
|
9102
|
-
hour = 0;
|
|
9103
|
-
}
|
|
9104
|
-
if (minute === void 0) {
|
|
9105
|
-
minute = 0;
|
|
9106
|
-
}
|
|
9107
|
-
if (second === void 0) {
|
|
9108
|
-
second = 0;
|
|
9109
|
-
}
|
|
9110
|
-
if (nanoOfSecond === void 0) {
|
|
9111
|
-
nanoOfSecond = 0;
|
|
9112
|
-
}
|
|
9113
|
-
_this = _Temporal.call(this) || this;
|
|
9114
|
-
var _hour = MathUtil.safeToInt(hour);
|
|
9115
|
-
var _minute = MathUtil.safeToInt(minute);
|
|
9116
|
-
var _second = MathUtil.safeToInt(second);
|
|
9117
|
-
var _nanoOfSecond = MathUtil.safeToInt(nanoOfSecond);
|
|
9118
|
-
LocalTime._validate(_hour, _minute, _second, _nanoOfSecond);
|
|
9119
|
-
if (_minute === 0 && _second === 0 && _nanoOfSecond === 0) {
|
|
9120
|
-
if (!LocalTime.HOURS[_hour]) {
|
|
9121
|
-
_this._hour = _hour;
|
|
9122
|
-
_this._minute = _minute;
|
|
9123
|
-
_this._second = _second;
|
|
9124
|
-
_this._nano = _nanoOfSecond;
|
|
9125
|
-
LocalTime.HOURS[_hour] = _assertThisInitialized(_this);
|
|
9126
|
-
}
|
|
9127
|
-
return LocalTime.HOURS[_hour] || _assertThisInitialized(_this);
|
|
9128
|
-
}
|
|
9129
|
-
_this._hour = _hour;
|
|
9130
|
-
_this._minute = _minute;
|
|
9131
|
-
_this._second = _second;
|
|
9132
|
-
_this._nano = _nanoOfSecond;
|
|
9133
|
-
return _this;
|
|
9134
|
-
}
|
|
9135
9137
|
LocalTime._validate = function _validate(hour, minute, second, nanoOfSecond) {
|
|
9136
9138
|
ChronoField.HOUR_OF_DAY.checkValidValue(hour);
|
|
9137
9139
|
ChronoField.MINUTE_OF_HOUR.checkValidValue(minute);
|
|
@@ -9556,6 +9558,14 @@ LocalTime.NANOS_PER_DAY = LocalTime.NANOS_PER_HOUR * LocalTime.HOURS_PER_DAY;
|
|
|
9556
9558
|
|
|
9557
9559
|
var NANOS_PER_MILLI = 1000000;
|
|
9558
9560
|
var Instant = function (_Temporal) {
|
|
9561
|
+
function Instant(seconds, nanoOfSecond) {
|
|
9562
|
+
var _this;
|
|
9563
|
+
_this = _Temporal.call(this) || this;
|
|
9564
|
+
Instant._validate(seconds, nanoOfSecond);
|
|
9565
|
+
_this._seconds = MathUtil.safeToInt(seconds);
|
|
9566
|
+
_this._nanos = MathUtil.safeToInt(nanoOfSecond);
|
|
9567
|
+
return _this;
|
|
9568
|
+
}
|
|
9559
9569
|
_inheritsLoose(Instant, _Temporal);
|
|
9560
9570
|
Instant.now = function now(clock) {
|
|
9561
9571
|
if (clock === void 0) {
|
|
@@ -9607,14 +9617,6 @@ var Instant = function (_Temporal) {
|
|
|
9607
9617
|
throw new DateTimeException('Instant exceeds minimum or maximum instant');
|
|
9608
9618
|
}
|
|
9609
9619
|
};
|
|
9610
|
-
function Instant(seconds, nanoOfSecond) {
|
|
9611
|
-
var _this;
|
|
9612
|
-
_this = _Temporal.call(this) || this;
|
|
9613
|
-
Instant._validate(seconds, nanoOfSecond);
|
|
9614
|
-
_this._seconds = MathUtil.safeToInt(seconds);
|
|
9615
|
-
_this._nanos = MathUtil.safeToInt(nanoOfSecond);
|
|
9616
|
-
return _this;
|
|
9617
|
-
}
|
|
9618
9620
|
var _proto = Instant.prototype;
|
|
9619
9621
|
_proto.isSupported = function isSupported(fieldOrUnit) {
|
|
9620
9622
|
if (fieldOrUnit instanceof ChronoField) {
|
|
@@ -9691,7 +9693,7 @@ var Instant = function (_Temporal) {
|
|
|
9691
9693
|
throw new DateTimeException('Unit must divide into a standard day without remainder');
|
|
9692
9694
|
}
|
|
9693
9695
|
var nod = MathUtil.intMod(this._seconds, LocalTime.SECONDS_PER_DAY) * LocalTime.NANOS_PER_SECOND + this._nanos;
|
|
9694
|
-
var result = MathUtil.
|
|
9696
|
+
var result = MathUtil.floorDiv(nod, dur) * dur;
|
|
9695
9697
|
return this.plusNanos(result - nod);
|
|
9696
9698
|
};
|
|
9697
9699
|
_proto._plusUnit = function _plusUnit(amountToAdd, unit) {
|
|
@@ -9907,7 +9909,6 @@ var Clock = function () {
|
|
|
9907
9909
|
return Clock;
|
|
9908
9910
|
}();
|
|
9909
9911
|
var SystemClock = function (_Clock) {
|
|
9910
|
-
_inheritsLoose(SystemClock, _Clock);
|
|
9911
9912
|
function SystemClock(zone) {
|
|
9912
9913
|
var _this;
|
|
9913
9914
|
requireNonNull(zone, 'zone');
|
|
@@ -9915,6 +9916,7 @@ var SystemClock = function (_Clock) {
|
|
|
9915
9916
|
_this._zone = zone;
|
|
9916
9917
|
return _this;
|
|
9917
9918
|
}
|
|
9919
|
+
_inheritsLoose(SystemClock, _Clock);
|
|
9918
9920
|
var _proto2 = SystemClock.prototype;
|
|
9919
9921
|
_proto2.zone = function zone() {
|
|
9920
9922
|
return this._zone;
|
|
@@ -9943,7 +9945,6 @@ var SystemClock = function (_Clock) {
|
|
|
9943
9945
|
return SystemClock;
|
|
9944
9946
|
}(Clock);
|
|
9945
9947
|
var FixedClock = function (_Clock2) {
|
|
9946
|
-
_inheritsLoose(FixedClock, _Clock2);
|
|
9947
9948
|
function FixedClock(fixedInstant, zoneId) {
|
|
9948
9949
|
var _this2;
|
|
9949
9950
|
_this2 = _Clock2.call(this) || this;
|
|
@@ -9951,6 +9952,7 @@ var FixedClock = function (_Clock2) {
|
|
|
9951
9952
|
_this2._zoneId = zoneId;
|
|
9952
9953
|
return _this2;
|
|
9953
9954
|
}
|
|
9955
|
+
_inheritsLoose(FixedClock, _Clock2);
|
|
9954
9956
|
var _proto3 = FixedClock.prototype;
|
|
9955
9957
|
_proto3.instant = function instant() {
|
|
9956
9958
|
return this._instant;
|
|
@@ -9979,7 +9981,6 @@ var FixedClock = function (_Clock2) {
|
|
|
9979
9981
|
return FixedClock;
|
|
9980
9982
|
}(Clock);
|
|
9981
9983
|
var OffsetClock = function (_Clock3) {
|
|
9982
|
-
_inheritsLoose(OffsetClock, _Clock3);
|
|
9983
9984
|
function OffsetClock(baseClock, offset) {
|
|
9984
9985
|
var _this3;
|
|
9985
9986
|
_this3 = _Clock3.call(this) || this;
|
|
@@ -9987,6 +9988,7 @@ var OffsetClock = function (_Clock3) {
|
|
|
9987
9988
|
_this3._offset = offset;
|
|
9988
9989
|
return _this3;
|
|
9989
9990
|
}
|
|
9991
|
+
_inheritsLoose(OffsetClock, _Clock3);
|
|
9990
9992
|
var _proto4 = OffsetClock.prototype;
|
|
9991
9993
|
_proto4.zone = function zone() {
|
|
9992
9994
|
return this._baseClock.zone();
|
|
@@ -10022,9 +10024,6 @@ var OffsetClock = function (_Clock3) {
|
|
|
10022
10024
|
*/
|
|
10023
10025
|
|
|
10024
10026
|
var ZoneOffsetTransition = function () {
|
|
10025
|
-
ZoneOffsetTransition.of = function of(transition, offsetBefore, offsetAfter) {
|
|
10026
|
-
return new ZoneOffsetTransition(transition, offsetBefore, offsetAfter);
|
|
10027
|
-
};
|
|
10028
10027
|
function ZoneOffsetTransition(transition, offsetBefore, offsetAfter) {
|
|
10029
10028
|
requireNonNull(transition, 'transition');
|
|
10030
10029
|
requireNonNull(offsetBefore, 'offsetBefore');
|
|
@@ -10043,6 +10042,9 @@ var ZoneOffsetTransition = function () {
|
|
|
10043
10042
|
this._offsetBefore = offsetBefore;
|
|
10044
10043
|
this._offsetAfter = offsetAfter;
|
|
10045
10044
|
}
|
|
10045
|
+
ZoneOffsetTransition.of = function of(transition, offsetBefore, offsetAfter) {
|
|
10046
|
+
return new ZoneOffsetTransition(transition, offsetBefore, offsetAfter);
|
|
10047
|
+
};
|
|
10046
10048
|
var _proto = ZoneOffsetTransition.prototype;
|
|
10047
10049
|
_proto.instant = function instant() {
|
|
10048
10050
|
return this._transition.toInstant(this._offsetBefore);
|
|
@@ -10147,10 +10149,10 @@ function _init$1() {
|
|
|
10147
10149
|
}
|
|
10148
10150
|
|
|
10149
10151
|
var SystemDefaultZoneRules = function (_ZoneRules) {
|
|
10150
|
-
_inheritsLoose(SystemDefaultZoneRules, _ZoneRules);
|
|
10151
10152
|
function SystemDefaultZoneRules() {
|
|
10152
10153
|
return _ZoneRules.apply(this, arguments) || this;
|
|
10153
10154
|
}
|
|
10155
|
+
_inheritsLoose(SystemDefaultZoneRules, _ZoneRules);
|
|
10154
10156
|
var _proto = SystemDefaultZoneRules.prototype;
|
|
10155
10157
|
_proto.isFixedOffset = function isFixedOffset() {
|
|
10156
10158
|
return false;
|
|
@@ -10217,13 +10219,13 @@ var SystemDefaultZoneRules = function (_ZoneRules) {
|
|
|
10217
10219
|
}(ZoneRules);
|
|
10218
10220
|
|
|
10219
10221
|
var SystemDefaultZoneId = function (_ZoneId) {
|
|
10220
|
-
_inheritsLoose(SystemDefaultZoneId, _ZoneId);
|
|
10221
10222
|
function SystemDefaultZoneId() {
|
|
10222
10223
|
var _this;
|
|
10223
10224
|
_this = _ZoneId.call(this) || this;
|
|
10224
10225
|
_this._rules = new SystemDefaultZoneRules();
|
|
10225
10226
|
return _this;
|
|
10226
10227
|
}
|
|
10228
|
+
_inheritsLoose(SystemDefaultZoneId, _ZoneId);
|
|
10227
10229
|
var _proto = SystemDefaultZoneId.prototype;
|
|
10228
10230
|
_proto.rules = function rules() {
|
|
10229
10231
|
return this._rules;
|