@js-joda/core 3.2.0 → 4.2.1

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.
Files changed (74) hide show
  1. package/CHANGELOG.md +32 -1
  2. package/README.md +43 -36
  3. package/dist/js-joda.d.ts +241 -179
  4. package/dist/js-joda.esm.js +11524 -10214
  5. package/dist/js-joda.js +11524 -10214
  6. package/dist/js-joda.js.map +1 -1
  7. package/dist/js-joda.min.js +2 -2
  8. package/package.json +10 -40
  9. package/src/Clock.js +8 -9
  10. package/src/DayOfWeek.js +14 -14
  11. package/src/Duration.js +15 -15
  12. package/src/Instant.js +40 -74
  13. package/src/LocalDate.js +71 -93
  14. package/src/LocalDateTime.js +25 -68
  15. package/src/LocalTime.js +27 -72
  16. package/src/MathUtil.js +3 -3
  17. package/src/Month.js +13 -13
  18. package/src/MonthDay.js +25 -25
  19. package/src/OffsetDateTime.js +29 -29
  20. package/src/OffsetTime.js +32 -32
  21. package/src/Period.js +12 -12
  22. package/src/StringUtil.js +1 -1
  23. package/src/Year.js +33 -115
  24. package/src/YearMonth.js +31 -113
  25. package/src/ZoneId.js +7 -7
  26. package/src/ZoneIdFactory.js +14 -14
  27. package/src/ZoneOffset.js +23 -23
  28. package/src/ZoneRegion.js +2 -2
  29. package/src/ZonedDateTime.js +31 -74
  30. package/src/_init.js +24 -24
  31. package/src/assert.js +31 -4
  32. package/src/chrono/ChronoLocalDate.js +8 -8
  33. package/src/chrono/ChronoLocalDateTime.js +10 -10
  34. package/src/chrono/ChronoZonedDateTime.js +8 -8
  35. package/src/chrono/IsoChronology.js +13 -13
  36. package/src/convert.js +12 -8
  37. package/src/errors.js +3 -3
  38. package/src/format/DateTimeBuilder.js +17 -17
  39. package/src/format/DateTimeFormatter.js +45 -24
  40. package/src/format/DateTimeFormatterBuilder.js +59 -59
  41. package/src/format/DateTimeParseContext.js +6 -6
  42. package/src/format/DateTimePrintContext.js +3 -3
  43. package/src/format/DecimalStyle.js +1 -1
  44. package/src/format/ResolverStyle.js +1 -1
  45. package/src/format/SignStyle.js +1 -1
  46. package/src/format/TextStyle.js +1 -1
  47. package/src/format/parser/CharLiteralPrinterParser.js +3 -3
  48. package/src/format/parser/FractionPrinterParser.js +10 -10
  49. package/src/format/parser/NumberPrinterParser.js +18 -18
  50. package/src/format/parser/OffsetIdPrinterParser.js +9 -9
  51. package/src/format/parser/PadPrinterParserDecorator.js +3 -3
  52. package/src/format/parser/StringLiteralPrinterParser.js +2 -2
  53. package/src/format/parser/ZoneIdPrinterParser.js +5 -5
  54. package/src/js-joda.js +5 -0
  55. package/src/temporal/ChronoField.js +5 -5
  56. package/src/temporal/ChronoUnit.js +6 -6
  57. package/src/temporal/IsoFields.js +12 -12
  58. package/src/temporal/NativeJsTemporal.js +11 -11
  59. package/src/temporal/Temporal.js +45 -38
  60. package/src/temporal/TemporalAccessor.js +14 -4
  61. package/src/temporal/TemporalAdjuster.js +1 -1
  62. package/src/temporal/TemporalAdjusters.js +6 -6
  63. package/src/temporal/TemporalAmount.js +1 -1
  64. package/src/temporal/TemporalQueriesFactory.js +6 -6
  65. package/src/temporal/TemporalQuery.js +4 -2
  66. package/src/temporal/TemporalUnit.js +1 -1
  67. package/src/temporal/ValueRange.js +15 -15
  68. package/src/use.js +6 -1
  69. package/src/zone/SystemDefaultZoneId.js +2 -2
  70. package/src/zone/SystemDefaultZoneRules.js +3 -3
  71. package/src/zone/ZoneOffsetTransition.js +7 -7
  72. package/src/zone/ZoneRules.js +4 -4
  73. package/src/zone/ZoneRulesProvider.js +2 -2
  74. package/src/temporal/DefaultInterfaceTemporal.js +0 -118
package/dist/js-joda.d.ts CHANGED
@@ -266,15 +266,7 @@ export abstract class TemporalAccessor {
266
266
  * discussion of the issues.
267
267
  */
268
268
  export abstract class Temporal extends TemporalAccessor {
269
- abstract isSupported(field: TemporalField): boolean;
270
- /**
271
- * Checks if the specified unit is supported.
272
- *
273
- * This checks if the date-time can be queried for the specified unit. If false, then calling
274
- * the plus and minus methods will throw an exception.
275
- */
276
- abstract isSupported(unit: TemporalUnit): boolean;
277
- abstract minus(amountToSubtract: number, unit: TemporalUnit): Temporal;
269
+ minus(amountToSubtract: number, unit: TemporalUnit): Temporal;
278
270
  /**
279
271
  * Returns an object of the same type as this object with an amount subtracted.
280
272
  *
@@ -291,8 +283,8 @@ export abstract class Temporal extends TemporalAccessor {
291
283
  *
292
284
  * Note that calling plus followed by minus is not guaranteed to return the same date-time.
293
285
  */
294
- abstract minus(amount: TemporalAmount): Temporal;
295
- abstract plus(amountToAdd: number, unit: TemporalUnit): Temporal;
286
+ minus(amount: TemporalAmount): Temporal;
287
+ plus(amountToAdd: number, unit: TemporalUnit): Temporal;
296
288
  /**
297
289
  * Returns an object of the same type as this object with an amount added.
298
290
  *
@@ -309,7 +301,49 @@ export abstract class Temporal extends TemporalAccessor {
309
301
  *
310
302
  * Note that calling plus followed by minus is not guaranteed to return the same date-time.
311
303
  */
312
- abstract plus(amount: TemporalAmount): Temporal;
304
+ plus(amount: TemporalAmount): Temporal;
305
+ /**
306
+ * Returns an adjusted object of the same type as this object with the adjustment made.
307
+ *
308
+ * This adjusts this date-time according to the rules of the specified adjuster. A simple
309
+ * adjuster might simply set the one of the fields, such as the year field. A more complex
310
+ * adjuster might set the date to the last day of the month. A selection of common adjustments
311
+ * is provided in `TemporalAdjusters`. These include finding the "last day of the month" and
312
+ * "next Wednesday". The adjuster is responsible for handling special cases, such as the
313
+ * varying lengths of month and leap years.
314
+ *
315
+ * Some example code indicating how and why this method is used:
316
+ * ```
317
+ * date = date.with(Month.JULY); // most key classes implement TemporalAdjuster
318
+ * date = date.with(lastDayOfMonth()); // static import from TemporalAdjusters
319
+ * date = date.with(next(WEDNESDAY)); // static import from TemporalAdjusters and DayOfWeek
320
+ * ```
321
+ */
322
+ with(adjuster: TemporalAdjuster): Temporal;
323
+ /**
324
+ * Returns an object of the same type as this object with the specified field altered.
325
+ *
326
+ * This returns a new object based on this one with the value for the specified field changed.
327
+ * For example, on a `LocalDate`, this could be used to set the year, month or day-of-month.
328
+ * The returned object will have the same observable type as this object.
329
+ *
330
+ * In some cases, changing a field is not fully defined. For example, if the target object is
331
+ * a date representing the 31st January, then changing the month to February would be unclear.
332
+ * In cases like this, the field is responsible for resolving the result. Typically it will
333
+ * choose the previous valid date, which would be the last valid day of February in this
334
+ * example.
335
+ */
336
+ with(field: TemporalField, newValue: number): Temporal;
337
+
338
+ abstract isSupported(field: TemporalField): boolean;
339
+ /**
340
+ * Checks if the specified unit is supported.
341
+ *
342
+ * This checks if the date-time can be queried for the specified unit. If false, then calling
343
+ * the plus and minus methods will throw an exception.
344
+ */
345
+ abstract isSupported(unit: TemporalUnit): boolean;
346
+
313
347
  /**
314
348
  * Calculates the period between this temporal and another temporal in terms of the
315
349
  * specified unit.
@@ -341,38 +375,14 @@ export abstract class Temporal extends TemporalAccessor {
341
375
  * ```
342
376
  */
343
377
  abstract until(endTemporal: Temporal, unit: TemporalUnit): number;
344
- /**
345
- * Returns an adjusted object of the same type as this object with the adjustment made.
346
- *
347
- * This adjusts this date-time according to the rules of the specified adjuster. A simple
348
- * adjuster might simply set the one of the fields, such as the year field. A more complex
349
- * adjuster might set the date to the last day of the month. A selection of common adjustments
350
- * is provided in `TemporalAdjusters`. These include finding the "last day of the month" and
351
- * "next Wednesday". The adjuster is responsible for handling special cases, such as the
352
- * varying lengths of month and leap years.
353
- *
354
- * Some example code indicating how and why this method is used:
355
- * ```
356
- * date = date.with(Month.JULY); // most key classes implement TemporalAdjuster
357
- * date = date.with(lastDayOfMonth()); // static import from TemporalAdjusters
358
- * date = date.with(next(WEDNESDAY)); // static import from TemporalAdjusters and DayOfWeek
359
- * ```
360
- */
361
- abstract with(adjuster: TemporalAdjuster): Temporal;
362
- /**
363
- * Returns an object of the same type as this object with the specified field altered.
364
- *
365
- * This returns a new object based on this one with the value for the specified field changed.
366
- * For example, on a `LocalDate`, this could be used to set the year, month or day-of-month.
367
- * The returned object will have the same observable type as this object.
368
- *
369
- * In some cases, changing a field is not fully defined. For example, if the target object is
370
- * a date representing the 31st January, then changing the month to February would be unclear.
371
- * In cases like this, the field is responsible for resolving the result. Typically it will
372
- * choose the previous valid date, which would be the last valid day of February in this
373
- * example.
374
- */
375
- abstract with(field: TemporalField, newValue: number): Temporal;
378
+
379
+ protected _minusUnit(amountToSubtract: number, unit: TemporalUnit): Temporal;
380
+ protected _minusAmount(amount: TemporalAmount): Temporal;
381
+ protected _plusAmount(amount: TemporalAmount): Temporal;
382
+ protected _withAdjuster(adjuster: TemporalAdjuster): Temporal;
383
+
384
+ protected abstract _plusUnit(amountToAdd: number, unit: TemporalUnit): Temporal;
385
+ protected abstract _withField(field: TemporalField, newValue: number): Temporal;
376
386
  }
377
387
 
378
388
  /**
@@ -1149,6 +1159,7 @@ export class Instant extends Temporal implements TemporalAdjuster {
1149
1159
  private constructor();
1150
1160
 
1151
1161
  adjustInto(temporal: Temporal): Temporal;
1162
+ atOffset(offset: ZoneOffset): OffsetDateTime;
1152
1163
  atZone(zone: ZoneId): ZonedDateTime;
1153
1164
  compareTo(otherInstant: Instant): number;
1154
1165
  epochSecond(): number;
@@ -1158,14 +1169,14 @@ export class Instant extends Temporal implements TemporalAdjuster {
1158
1169
  isAfter(otherInstant: Instant): boolean;
1159
1170
  isBefore(otherInstant: Instant): boolean;
1160
1171
  isSupported(fieldOrUnit: TemporalField | TemporalUnit): boolean;
1161
- minus(amount: TemporalAmount): Instant;
1162
1172
  minus(amountToSubtract: number, unit: TemporalUnit): Instant;
1173
+ minus(amount: TemporalAmount): Instant;
1163
1174
  minusMillis(millisToSubtract: number): Instant;
1164
1175
  minusNanos(nanosToSubtract: number): Instant;
1165
1176
  minusSeconds(secondsToSubtract: number): Instant;
1166
1177
  nano(): number;
1167
- plus(amount: TemporalAmount): Instant;
1168
1178
  plus(amountToAdd: number, unit: TemporalUnit): Instant;
1179
+ plus(amount: TemporalAmount): Instant;
1169
1180
  plusMillis(millisToAdd: number): Instant;
1170
1181
  plusNanos(nanosToAdd: number): Instant;
1171
1182
  plusSeconds(secondsToAdd: number): Instant;
@@ -1176,6 +1187,13 @@ export class Instant extends Temporal implements TemporalAdjuster {
1176
1187
  until(endExclusive: Temporal, unit: TemporalUnit): number;
1177
1188
  with(adjuster: TemporalAdjuster): Instant;
1178
1189
  with(field: TemporalField, newValue: number): Instant;
1190
+
1191
+ protected _minusUnit(amountToSubtract: number, unit: TemporalUnit): Instant;
1192
+ protected _minusAmount(amount: TemporalAmount): Instant;
1193
+ protected _plusUnit(amountToAdd: number, unit: TemporalUnit): Instant;
1194
+ protected _plusAmount(amount: TemporalAmount): Instant;
1195
+ protected _withAdjuster(adjuster: TemporalAdjuster): Instant;
1196
+ protected _withField(field: TemporalField, newValue: number): Instant;
1179
1197
  }
1180
1198
 
1181
1199
  export class LocalDate extends ChronoLocalDate implements TemporalAdjuster {
@@ -1199,6 +1217,7 @@ export class LocalDate extends ChronoLocalDate implements TemporalAdjuster {
1199
1217
  atStartOfDay(zone: ZoneId): ZonedDateTime;
1200
1218
  atTime(hour: number, minute: number, second?: number, nanoOfSecond?: number): LocalDateTime;
1201
1219
  atTime(time: LocalTime): LocalDateTime;
1220
+ atTime(time: OffsetTime): OffsetDateTime;
1202
1221
  chronology(): Chronology;
1203
1222
  compareTo(other: LocalDate): number;
1204
1223
  dayOfMonth(): number;
@@ -1216,16 +1235,16 @@ export class LocalDate extends ChronoLocalDate implements TemporalAdjuster {
1216
1235
  isSupported(fieldOrUnit: TemporalField | TemporalUnit): boolean;
1217
1236
  lengthOfMonth(): number;
1218
1237
  lengthOfYear(): number;
1219
- minus(amount: TemporalAmount): LocalDate;
1220
1238
  minus(amountToSubtract: number, unit: TemporalUnit): LocalDate;
1239
+ minus(amount: TemporalAmount): LocalDate;
1221
1240
  minusDays(daysToSubtract: number): LocalDate;
1222
1241
  minusMonths(monthsToSubtract: number): LocalDate;
1223
1242
  minusWeeks(weeksToSubtract: number): LocalDate;
1224
1243
  minusYears(yearsToSubtract: number): LocalDate;
1225
1244
  month(): Month;
1226
1245
  monthValue(): number;
1227
- plus(amount: TemporalAmount): LocalDate;
1228
1246
  plus(amountToAdd: number, unit: TemporalUnit): LocalDate;
1247
+ plus(amount: TemporalAmount): LocalDate;
1229
1248
  plusDays(daysToAdd: number): LocalDate;
1230
1249
  plusMonths(monthsToAdd: number): LocalDate;
1231
1250
  plusWeeks(weeksToAdd: number): LocalDate;
@@ -1242,6 +1261,13 @@ export class LocalDate extends ChronoLocalDate implements TemporalAdjuster {
1242
1261
  withMonth(month: Month | number): LocalDate;
1243
1262
  withYear(year: number): LocalDate;
1244
1263
  year(): number;
1264
+
1265
+ protected _minusUnit(amountToSubtract: number, unit: TemporalUnit): LocalDate;
1266
+ protected _minusAmount(amount: TemporalAmount): LocalDate;
1267
+ protected _plusUnit(amountToAdd: number, unit: TemporalUnit): LocalDate;
1268
+ protected _plusAmount(amount: TemporalAmount): LocalDate;
1269
+ protected _withAdjuster(adjuster: TemporalAdjuster): LocalDate;
1270
+ protected _withField(field: TemporalField, newValue: number): LocalDate;
1245
1271
  }
1246
1272
 
1247
1273
  export class LocalDateTime extends ChronoLocalDateTime implements TemporalAdjuster {
@@ -1276,8 +1302,8 @@ export class LocalDateTime extends ChronoLocalDateTime implements TemporalAdjust
1276
1302
  isBefore(other: LocalDateTime): boolean;
1277
1303
  isEqual(other: LocalDateTime): boolean;
1278
1304
  isSupported(fieldOrUnit: TemporalField | TemporalUnit): boolean;
1279
- minus(amount: TemporalAmount): LocalDateTime;
1280
1305
  minus(amountToSubtract: number, unit: TemporalUnit): LocalDateTime;
1306
+ minus(amount: TemporalAmount): LocalDateTime;
1281
1307
  minusDays(days: number): LocalDateTime;
1282
1308
  minusHours(hours: number): LocalDateTime;
1283
1309
  minusMinutes(minutes: number): LocalDateTime;
@@ -1290,8 +1316,8 @@ export class LocalDateTime extends ChronoLocalDateTime implements TemporalAdjust
1290
1316
  month(): Month;
1291
1317
  monthValue(): number;
1292
1318
  nano(): number;
1293
- plus(amount: TemporalAmount): LocalDateTime;
1294
1319
  plus(amountToAdd: number, unit: TemporalUnit): LocalDateTime;
1320
+ plus(amount: TemporalAmount): LocalDateTime;
1295
1321
  plusDays(days: number): LocalDateTime;
1296
1322
  plusHours(hours: number): LocalDateTime;
1297
1323
  plusMinutes(minutes: number): LocalDateTime;
@@ -1318,6 +1344,13 @@ export class LocalDateTime extends ChronoLocalDateTime implements TemporalAdjust
1318
1344
  withSecond(second: number): LocalDateTime;
1319
1345
  withYear(year: number): LocalDateTime;
1320
1346
  year(): number;
1347
+
1348
+ protected _minusUnit(amountToSubtract: number, unit: TemporalUnit): LocalDateTime;
1349
+ protected _minusAmount(amount: TemporalAmount): LocalDateTime;
1350
+ protected _plusUnit(amountToAdd: number, unit: TemporalUnit): LocalDateTime;
1351
+ protected _plusAmount(amount: TemporalAmount): LocalDateTime;
1352
+ protected _withAdjuster(adjuster: TemporalAdjuster): LocalDateTime;
1353
+ protected _withField(field: TemporalField, newValue: number): LocalDateTime;
1321
1354
  }
1322
1355
 
1323
1356
  export class LocalTime extends Temporal implements TemporalAdjuster {
@@ -1352,6 +1385,7 @@ export class LocalTime extends Temporal implements TemporalAdjuster {
1352
1385
 
1353
1386
  adjustInto(temporal: Temporal): Temporal;
1354
1387
  atDate(date: LocalDate): LocalDateTime;
1388
+ atOffset(offset: ZoneOffset): OffsetTime;
1355
1389
  compareTo(other: LocalTime): number;
1356
1390
  equals(other: any): boolean;
1357
1391
  format(formatter: DateTimeFormatter): string;
@@ -1361,16 +1395,16 @@ export class LocalTime extends Temporal implements TemporalAdjuster {
1361
1395
  isAfter(other: LocalTime): boolean;
1362
1396
  isBefore(other: LocalTime): boolean;
1363
1397
  isSupported(fieldOrUnit: TemporalField | TemporalUnit): boolean;
1364
- minus(amount: TemporalAmount): LocalTime;
1365
1398
  minus(amountToSubtract: number, unit: TemporalUnit): LocalTime;
1399
+ minus(amount: TemporalAmount): LocalTime;
1366
1400
  minusHours(hoursToSubtract: number): LocalTime;
1367
1401
  minusMinutes(minutesToSubtract: number): LocalTime;
1368
1402
  minusNanos(nanosToSubtract: number): LocalTime;
1369
1403
  minusSeconds(secondsToSubtract: number): LocalTime;
1370
1404
  minute(): number;
1371
1405
  nano(): number;
1372
- plus(amount: TemporalAmount): LocalTime;
1373
1406
  plus(amountToAdd: number, unit: TemporalUnit): LocalTime;
1407
+ plus(amount: TemporalAmount): LocalTime;
1374
1408
  plusHours(hoursToAdd: number): LocalTime;
1375
1409
  plusMinutes(minutesToAdd: number): LocalTime;
1376
1410
  plusNanos(nanosToAdd: number): LocalTime;
@@ -1389,6 +1423,13 @@ export class LocalTime extends Temporal implements TemporalAdjuster {
1389
1423
  withMinute(minute: number): LocalTime;
1390
1424
  withNano(nanoOfSecond: number): LocalTime;
1391
1425
  withSecond(second: number): LocalTime;
1426
+
1427
+ protected _minusUnit(amountToSubtract: number, unit: TemporalUnit): LocalTime;
1428
+ protected _minusAmount(amount: TemporalAmount): LocalTime;
1429
+ protected _plusUnit(amountToAdd: number, unit: TemporalUnit): LocalTime;
1430
+ protected _plusAmount(amount: TemporalAmount): LocalTime;
1431
+ protected _withAdjuster(adjuster: TemporalAdjuster): LocalTime;
1432
+ protected _withField(field: TemporalField, newValue: number): LocalTime;
1392
1433
  }
1393
1434
 
1394
1435
  export class MonthDay extends TemporalAccessor implements TemporalAdjuster {
@@ -1493,11 +1534,11 @@ export class Year extends Temporal implements TemporalAdjuster {
1493
1534
  isSupported(fieldOrUnit: TemporalField | TemporalUnit): boolean;
1494
1535
  isValidMonthDay(monthDay: MonthDay): boolean;
1495
1536
  length(): number;
1496
- minus(amount: TemporalAmount): Year;
1497
1537
  minus(amountToSubtract: number, unit: TemporalUnit): Year;
1538
+ minus(amount: TemporalAmount): Year;
1498
1539
  minusYears(yearsToSubtract: number): Year;
1499
- plus(amount: TemporalAmount): Year;
1500
1540
  plus(amountToAdd: number, unit: TemporalUnit): Year;
1541
+ plus(amount: TemporalAmount): Year;
1501
1542
  plusYears(yearsToAdd: number): Year;
1502
1543
  toJSON(): string;
1503
1544
  toString(): string;
@@ -1505,6 +1546,13 @@ export class Year extends Temporal implements TemporalAdjuster {
1505
1546
  value(): number;
1506
1547
  with(adjuster: TemporalAdjuster): Year;
1507
1548
  with(field: TemporalField, newValue: number): Year;
1549
+
1550
+ protected _minusUnit(amountToSubtract: number, unit: TemporalUnit): Year;
1551
+ protected _minusAmount(amount: TemporalAmount): Year;
1552
+ protected _plusUnit(amountToAdd: number, unit: TemporalUnit): Year;
1553
+ protected _plusAmount(amount: TemporalAmount): Year;
1554
+ protected _withAdjuster(adjuster: TemporalAdjuster): Year;
1555
+ protected _withField(field: TemporalField, newValue: number): Year;
1508
1556
  }
1509
1557
 
1510
1558
  export class YearMonth extends Temporal implements TemporalAdjuster {
@@ -1531,14 +1579,14 @@ export class YearMonth extends Temporal implements TemporalAdjuster {
1531
1579
  isValidDay(): boolean;
1532
1580
  lengthOfMonth(): number;
1533
1581
  lengthOfYear(): number;
1534
- minus(amount: TemporalAmount): YearMonth;
1535
1582
  minus(amountToSubtract: number, unit: TemporalUnit): YearMonth;
1583
+ minus(amount: TemporalAmount): YearMonth;
1536
1584
  minusMonths(monthsToSubtract: number): YearMonth;
1537
1585
  minusYears(yearsToSubtract: number): YearMonth;
1538
1586
  month(): Month;
1539
1587
  monthValue(): number;
1540
- plus(amount: TemporalAmount): YearMonth;
1541
1588
  plus(amountToAdd: number, unit: TemporalUnit): YearMonth;
1589
+ plus(amount: TemporalAmount): YearMonth;
1542
1590
  plusMonths(monthsToAdd: number): YearMonth;
1543
1591
  plusYears(yearsToAdd: number): YearMonth;
1544
1592
  toJSON(): string;
@@ -1548,6 +1596,13 @@ export class YearMonth extends Temporal implements TemporalAdjuster {
1548
1596
  withMonth(month: number): YearMonth;
1549
1597
  withYear(year: number): YearMonth;
1550
1598
  year(): number;
1599
+
1600
+ protected _minusUnit(amountToSubtract: number, unit: TemporalUnit): YearMonth;
1601
+ protected _minusAmount(amount: TemporalAmount): YearMonth;
1602
+ protected _plusUnit(amountToAdd: number, unit: TemporalUnit): YearMonth;
1603
+ protected _plusAmount(amount: TemporalAmount): YearMonth;
1604
+ protected _withAdjuster(adjuster: TemporalAdjuster): YearMonth;
1605
+ protected _withField(field: TemporalField, newValue: number): YearMonth;
1551
1606
  }
1552
1607
 
1553
1608
  /**
@@ -1587,74 +1642,78 @@ export class OffsetDateTime extends Temporal implements TemporalAdjuster {
1587
1642
 
1588
1643
  private constructor();
1589
1644
 
1590
- adjustInto(temporal: Temporal): Temporal
1591
- atZoneSameInstant(zone: ZoneId): ZonedDateTime
1592
- atZoneSimilarLocal(zone: ZoneId): ZonedDateTime
1593
- compareTo(other: OffsetDateTime): number
1594
- equals(obj: any): boolean
1595
- format(formatter: DateTimeFormatter): string
1596
- get(field: TemporalField): number
1597
- dayOfMonth(): number
1598
- dayOfWeek(): DayOfWeek
1599
- dayOfYear(): number
1600
- hour(): number
1601
- getLong(field: TemporalField): number
1602
- minute(): number
1603
- month(): Month
1604
- monthValue(): number
1605
- nano(): number
1606
- offset(): ZoneOffset
1607
- second(): number
1608
- year(): number
1609
- hashCode(): number
1610
- isAfter(other: OffsetDateTime): boolean
1611
- isBefore(other: OffsetDateTime): boolean
1612
- isEqual(other: OffsetDateTime): boolean
1613
- isSupported(fieldOrUnit: TemporalField | TemporalUnit): boolean
1614
- minus(amountToSubtract: number, unit: TemporalUnit): OffsetDateTime
1615
- minus(amountToSubtract: TemporalAmount): OffsetDateTime
1616
- minusDays(days: number): OffsetDateTime
1617
- minusHours(hours: number): OffsetDateTime
1618
- minusMinutes(minutes: number): OffsetDateTime
1619
- minusMonths(months: number): OffsetDateTime
1620
- minusNanos(nanos: number): OffsetDateTime
1621
- minusSeconds(seconds: number): OffsetDateTime
1622
- minusWeeks(weeks: number): OffsetDateTime
1623
- minusYears(years: number): OffsetDateTime
1624
- plus(amountToAdd: number, unit: TemporalUnit): OffsetDateTime
1625
- plus(amountToAdd: TemporalAmount): OffsetDateTime
1626
- plusDays(days: number): OffsetDateTime
1627
- plusHours(hours: number): OffsetDateTime
1628
- plusMinutes(minutes: number): OffsetDateTime
1629
- plusMonths(months: number): OffsetDateTime
1630
- plusNanos(nanos: number): OffsetDateTime
1631
- plusSeconds(seconds: number): OffsetDateTime
1632
- plusWeeks(weeks: number): OffsetDateTime
1633
- plusYears(years: number): OffsetDateTime
1634
- query<T>(query: TemporalQuery<T>): T
1635
- range(field: TemporalField): ValueRange
1636
- toEpochSecond(): number
1645
+ adjustInto(temporal: Temporal): Temporal;
1646
+ atZoneSameInstant(zone: ZoneId): ZonedDateTime;
1647
+ atZoneSimilarLocal(zone: ZoneId): ZonedDateTime;
1648
+ compareTo(other: OffsetDateTime): number;
1649
+ dayOfMonth(): number;
1650
+ dayOfWeek(): DayOfWeek;
1651
+ dayOfYear(): number;
1652
+ equals(other: any): boolean;
1653
+ format(formatter: DateTimeFormatter): string;
1654
+ getLong(field: TemporalField): number;
1655
+ hashCode(): number;
1656
+ hour(): number;
1657
+ isAfter(other: OffsetDateTime): boolean;
1658
+ isBefore(other: OffsetDateTime): boolean;
1659
+ isEqual(other: OffsetDateTime): boolean;
1660
+ isSupported(fieldOrUnit: TemporalField | TemporalUnit): boolean;
1661
+ minus(amountToSubtract: number, unit: TemporalUnit): OffsetDateTime;
1662
+ minus(amount: TemporalAmount): OffsetDateTime;
1663
+ minusDays(days: number): OffsetDateTime;
1664
+ minusHours(hours: number): OffsetDateTime;
1665
+ minusMinutes(minutes: number): OffsetDateTime;
1666
+ minusMonths(months: number): OffsetDateTime;
1667
+ minusNanos(nanos: number): OffsetDateTime;
1668
+ minusSeconds(seconds: number): OffsetDateTime;
1669
+ minusWeeks(weeks: number): OffsetDateTime;
1670
+ minusYears(years: number): OffsetDateTime;
1671
+ minute(): number;
1672
+ month(): Month;
1673
+ monthValue(): number;
1674
+ nano(): number;
1675
+ offset(): ZoneOffset;
1676
+ plus(amountToAdd: number, unit: TemporalUnit): OffsetDateTime;
1677
+ plus(amount: TemporalAmount): OffsetDateTime;
1678
+ plusDays(days: number): OffsetDateTime;
1679
+ plusHours(hours: number): OffsetDateTime;
1680
+ plusMinutes(minutes: number): OffsetDateTime;
1681
+ plusMonths(months: number): OffsetDateTime;
1682
+ plusNanos(nanos: number): OffsetDateTime;
1683
+ plusSeconds(seconds: number): OffsetDateTime;
1684
+ plusWeeks(weeks: number): OffsetDateTime;
1685
+ plusYears(years: number): OffsetDateTime;
1686
+ second(): number;
1687
+ toEpochSecond(): number;
1688
+ toInstant(): Instant;
1637
1689
  toJSON(): string;
1638
- toInstant(): Instant
1639
- toLocalDate(): LocalDate
1640
- toLocalDateTime(): LocalDateTime
1641
- toLocalTime(): LocalTime
1642
- toOffsetTime(): OffsetTime
1643
- toString(): string
1644
- truncatedTo(unit: TemporalUnit): OffsetDateTime
1645
- until(endExclusive: Temporal, unit: TemporalUnit): number
1646
- with(adjuster: TemporalAdjuster): OffsetDateTime
1647
- with(field: TemporalField, newValue: number): OffsetDateTime
1648
- withDayOfMonth(dayOfMonth: number): OffsetDateTime
1649
- withDayOfYear(dayOfYear: number): OffsetDateTime
1650
- withHour(hour: number): OffsetDateTime
1651
- withMinute(minute: number): OffsetDateTime
1652
- withMonth(month: number): OffsetDateTime
1653
- withNano(nanoOfSecond: number): OffsetDateTime
1654
- withOffsetSameInstant(offset: ZoneOffset): OffsetDateTime
1655
- withOffsetSameLocal(offset: ZoneOffset): OffsetDateTime
1656
- withSecond(second: number): OffsetDateTime
1657
- withYear(year: number): OffsetDateTime
1690
+ toLocalDate(): LocalDate;
1691
+ toLocalDateTime(): LocalDateTime;
1692
+ toLocalTime(): LocalTime;
1693
+ toOffsetTime(): OffsetTime;
1694
+ toString(): string;
1695
+ truncatedTo(unit: TemporalUnit): OffsetDateTime;
1696
+ until(endExclusive: Temporal, unit: TemporalUnit): number;
1697
+ with(adjuster: TemporalAdjuster): OffsetDateTime;
1698
+ with(field: TemporalField, newValue: number): OffsetDateTime;
1699
+ withDayOfMonth(dayOfMonth: number): OffsetDateTime;
1700
+ withDayOfYear(dayOfYear: number): OffsetDateTime;
1701
+ withHour(hour: number): OffsetDateTime;
1702
+ withMinute(minute: number): OffsetDateTime;
1703
+ withMonth(month: number): OffsetDateTime;
1704
+ withNano(nanoOfSecond: number): OffsetDateTime;
1705
+ withOffsetSameInstant(offset: ZoneOffset): OffsetDateTime;
1706
+ withOffsetSameLocal(offset: ZoneOffset): OffsetDateTime;
1707
+ withSecond(second: number): OffsetDateTime;
1708
+ withYear(year: number): OffsetDateTime;
1709
+ year(): number;
1710
+
1711
+ protected _minusUnit(amountToSubtract: number, unit: TemporalUnit): OffsetDateTime;
1712
+ protected _minusAmount(amount: TemporalAmount): OffsetDateTime;
1713
+ protected _plusUnit(amountToAdd: number, unit: TemporalUnit): OffsetDateTime;
1714
+ protected _plusAmount(amount: TemporalAmount): OffsetDateTime;
1715
+ protected _withAdjuster(adjuster: TemporalAdjuster): OffsetDateTime;
1716
+ protected _withField(field: TemporalField, newValue: number): OffsetDateTime;
1658
1717
  }
1659
1718
 
1660
1719
  /**
@@ -1683,51 +1742,55 @@ export class OffsetTime extends Temporal implements TemporalAdjuster {
1683
1742
 
1684
1743
  private constructor();
1685
1744
 
1686
- adjustInto(temporal: Temporal): Temporal
1687
- atDate(date: LocalDate): OffsetDateTime
1688
- compareTo(other: OffsetTime): number
1689
- equals(other: any): boolean
1690
- format(formatter: DateTimeFormatter): string
1691
- get(field: TemporalField): number
1692
- hour(): number
1693
- getLong(field: TemporalField): number
1694
- minute(): number
1695
- nano(): number
1696
- offset(): ZoneOffset
1697
- second(): number
1698
- hashCode(): number
1699
- isAfter(other: OffsetTime): boolean
1700
- isBefore(other: OffsetTime): boolean
1701
- isEqual(other: OffsetTime): boolean
1702
- isSupported(fieldOrUnit: TemporalField | TemporalUnit): boolean
1703
- minus(amountToSubtract: number, unit: TemporalUnit): OffsetTime
1704
- minus(amountToSubtract: TemporalAmount): OffsetTime
1705
- minusHours(hours: number): OffsetTime
1706
- minusMinutes(minutes: number): OffsetTime
1707
- minusNanos(nanos: number): OffsetTime
1708
- minusSeconds(seconds: number): OffsetTime
1709
- plus(amountToAdd: number, unit: TemporalUnit): OffsetTime
1710
- plus(amountToAdd: TemporalAmount): OffsetTime
1711
- plusHours(hours: number): OffsetTime
1712
- plusMinutes(minutes: number): OffsetTime
1713
- plusNanos(nanos: number): OffsetTime
1714
- plusSeconds(seconds: number): OffsetTime
1715
- query<T>(query: TemporalQuery<T>): T
1716
- range(field: TemporalField): ValueRange
1717
- toEpochSecond(date: LocalDate): number
1745
+ adjustInto(temporal: Temporal): Temporal;
1746
+ atDate(date: LocalDate): OffsetDateTime;
1747
+ compareTo(other: OffsetTime): number;
1748
+ equals(other: any): boolean;
1749
+ format(formatter: DateTimeFormatter): string;
1750
+ getLong(field: TemporalField): number;
1751
+ hashCode(): number;
1752
+ hour(): number;
1753
+ isAfter(other: OffsetTime): boolean;
1754
+ isBefore(other: OffsetTime): boolean;
1755
+ isEqual(other: OffsetTime): boolean;
1756
+ isSupported(fieldOrUnit: TemporalField | TemporalUnit): boolean;
1757
+ minus(amountToSubtract: number, unit: TemporalUnit): OffsetTime;
1758
+ minus(amount: TemporalAmount): OffsetTime;
1759
+ minusHours(hours: number): OffsetTime;
1760
+ minusMinutes(minutes: number): OffsetTime;
1761
+ minusNanos(nanos: number): OffsetTime;
1762
+ minusSeconds(seconds: number): OffsetTime;
1763
+ minute(): number;
1764
+ nano(): number;
1765
+ offset(): ZoneOffset;
1766
+ plus(amountToAdd: number, unit: TemporalUnit): OffsetTime;
1767
+ plus(amount: TemporalAmount): OffsetTime;
1768
+ plusHours(hours: number): OffsetTime;
1769
+ plusMinutes(minutes: number): OffsetTime;
1770
+ plusNanos(nanos: number): OffsetTime;
1771
+ plusSeconds(seconds: number): OffsetTime;
1772
+ second(): number;
1773
+ toEpochSecond(date: LocalDate): number;
1718
1774
  toJSON(): string;
1719
- toLocalTime(): LocalTime
1720
- toString(): string
1721
- truncatedTo(unit: TemporalUnit): OffsetTime
1722
- until(endExclusive: Temporal, unit: TemporalUnit): number
1723
- with(adjuster: TemporalAdjuster): OffsetTime
1724
- with(field: TemporalField, newValue: number): OffsetTime
1725
- withHour(hour: number): OffsetTime
1726
- withMinute(minute: number): OffsetTime
1727
- withNano(nanoOfSecond: number): OffsetTime
1728
- withOffsetSameInstant(offset: ZoneOffset): OffsetTime
1729
- withOffsetSameLocal(offset: ZoneOffset): OffsetTime
1730
- withSecond(second: number): OffsetTime
1775
+ toLocalTime(): LocalTime;
1776
+ toString(): string;
1777
+ truncatedTo(unit: TemporalUnit): OffsetTime;
1778
+ until(endExclusive: Temporal, unit: TemporalUnit): number;
1779
+ with(adjuster: TemporalAdjuster): OffsetTime;
1780
+ with(field: TemporalField, newValue: number): OffsetTime;
1781
+ withHour(hour: number): OffsetTime;
1782
+ withMinute(minute: number): OffsetTime;
1783
+ withNano(nanoOfSecond: number): OffsetTime;
1784
+ withOffsetSameInstant(offset: ZoneOffset): OffsetTime;
1785
+ withOffsetSameLocal(offset: ZoneOffset): OffsetTime;
1786
+ withSecond(second: number): OffsetTime;
1787
+
1788
+ protected _minusUnit(amountToSubtract: number, unit: TemporalUnit): OffsetTime;
1789
+ protected _minusAmount(amount: TemporalAmount): OffsetTime;
1790
+ protected _plusUnit(amountToAdd: number, unit: TemporalUnit): OffsetTime;
1791
+ protected _plusAmount(amount: TemporalAmount): OffsetTime;
1792
+ protected _withAdjuster(adjuster: TemporalAdjuster): OffsetTime;
1793
+ protected _withField(field: TemporalField, newValue: number): OffsetTime;
1731
1794
  }
1732
1795
 
1733
1796
  /**
@@ -1838,13 +1901,12 @@ export class ZonedDateTime extends ChronoZonedDateTime {
1838
1901
  dayOfWeek(): DayOfWeek;
1839
1902
  dayOfYear(): number;
1840
1903
  equals(other: any): boolean;
1841
- format(formatter: DateTimeFormatter): string;
1842
1904
  getLong(field: TemporalField): number;
1843
1905
  hashCode(): number;
1844
1906
  hour(): number;
1845
1907
  isSupported(fieldOrUnit: TemporalField | TemporalUnit): boolean;
1846
- minus(amount: TemporalAmount): ZonedDateTime;
1847
1908
  minus(amountToSubtract: number, unit: TemporalUnit): ZonedDateTime;
1909
+ minus(amount: TemporalAmount): ZonedDateTime;
1848
1910
  minusDays(days: number): ZonedDateTime;
1849
1911
  minusHours(hours: number): ZonedDateTime;
1850
1912
  minusMinutes(minutes: number): ZonedDateTime;
@@ -1858,8 +1920,8 @@ export class ZonedDateTime extends ChronoZonedDateTime {
1858
1920
  monthValue(): number;
1859
1921
  nano(): number;
1860
1922
  offset(): ZoneOffset;
1861
- plus(amount: TemporalAmount): ZonedDateTime;
1862
1923
  plus(amountToAdd: number, unit: TemporalUnit): ZonedDateTime;
1924
+ plus(amount: TemporalAmount): ZonedDateTime;
1863
1925
  plusDays(days: number): ZonedDateTime;
1864
1926
  plusHours(hours: number): ZonedDateTime;
1865
1927
  plusMinutes(minutes: number): ZonedDateTime;
@@ -1949,6 +2011,13 @@ export class ZonedDateTime extends ChronoZonedDateTime {
1949
2011
  withZoneSameLocal(zone: ZoneId): ZonedDateTime;
1950
2012
  year(): number;
1951
2013
  zone(): ZoneId;
2014
+
2015
+ protected _minusUnit(amountToSubtract: number, unit: TemporalUnit): ZonedDateTime;
2016
+ protected _minusAmount(amount: TemporalAmount): ZonedDateTime;
2017
+ protected _plusUnit(amountToAdd: number, unit: TemporalUnit): ZonedDateTime;
2018
+ protected _plusAmount(amount: TemporalAmount): ZonedDateTime;
2019
+ protected _withAdjuster(adjuster: TemporalAdjuster): ZonedDateTime;
2020
+ protected _withField(field: TemporalField, newValue: number): ZonedDateTime;
1952
2021
  }
1953
2022
 
1954
2023
  export abstract class ZoneId {
@@ -2028,7 +2097,6 @@ export class DayOfWeek extends TemporalAccessor implements TemporalAdjuster {
2028
2097
  adjustInto(temporal: Temporal): Temporal;
2029
2098
  compareTo(other: DayOfWeek): number;
2030
2099
  equals(other: any): boolean;
2031
- displayName(style: TextStyle, locale: Locale): string;
2032
2100
  getLong(field: TemporalField): number;
2033
2101
  isSupported(field: TemporalField): boolean;
2034
2102
  minus(days: number): DayOfWeek;
@@ -2066,7 +2134,6 @@ export class Month extends TemporalAccessor implements TemporalAdjuster {
2066
2134
  equals(other: any): boolean;
2067
2135
  firstDayOfYear(leapYear: boolean): number;
2068
2136
  firstMonthOfQuarter(): Month;
2069
- displayName(style: TextStyle, locale: Locale): string;
2070
2137
  getLong(field: TemporalField): number;
2071
2138
  isSupported(field: TemporalField): boolean;
2072
2139
  length(leapYear: boolean): number;
@@ -2091,6 +2158,7 @@ export class DateTimeFormatter {
2091
2158
  static ISO_LOCAL_DATE_TIME: DateTimeFormatter;
2092
2159
  static ISO_INSTANT: DateTimeFormatter;
2093
2160
  static ISO_OFFSET_DATE_TIME: DateTimeFormatter;
2161
+ static ISO_OFFSET_TIME: DateTimeFormatter;
2094
2162
  static ISO_ZONED_DATE_TIME: DateTimeFormatter;
2095
2163
 
2096
2164
  static ofPattern(pattern: string): DateTimeFormatter;
@@ -2102,13 +2170,11 @@ export class DateTimeFormatter {
2102
2170
  chronology(): Chronology | null;
2103
2171
  decimalStyle(): DecimalStyle;
2104
2172
  format(temporal: TemporalAccessor): string;
2105
- locale(): any;
2106
2173
  parse(text: string): TemporalAccessor;
2107
2174
  parse<T>(text: string, query: TemporalQuery<T>): T;
2108
2175
  parseUnresolved(text: string, position: ParsePosition): TemporalAccessor;
2109
2176
  toString(): string;
2110
2177
  withChronology(chrono: Chronology): DateTimeFormatter;
2111
- withLocale(locale: Locale): DateTimeFormatter;
2112
2178
  withResolverStyle(resolverStyle: ResolverStyle): DateTimeFormatter;
2113
2179
  }
2114
2180
 
@@ -2410,14 +2476,10 @@ export abstract class ChronoZonedDateTime extends Temporal {
2410
2476
  // SUPPORT
2411
2477
  // ----------------------------------------------------------------------------
2412
2478
 
2413
- export interface Locale {
2414
- // TODO: Not implemented yet
2415
- }
2416
-
2417
2479
  export function nativeJs(date: Date | any, zone?: ZoneId): TemporalAccessor;
2418
2480
 
2419
2481
  export function convert(
2420
- temporal: LocalDate | LocalDateTime | ZonedDateTime,
2482
+ temporal: LocalDate | LocalDateTime | ZonedDateTime | Instant,
2421
2483
  zone?: ZoneId,
2422
2484
  ): {
2423
2485
  toDate: () => Date;