@js-joda/core 5.3.2 → 5.4.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.
package/README.md CHANGED
@@ -1,12 +1,12 @@
1
1
  # Immutable date and time library for JavaScript
2
2
 
3
3
  [![npm version](https://badge.fury.io/js/%40js-joda%2Fcore.svg)](https://badge.fury.io/js/%40js-joda%2Fcore)
4
- [![Travis Build Status](https://app.travis-ci.com/js-joda/js-joda.svg?branch=master)](https://app.travis-ci.com/js-joda/js-joda)
4
+ [![GH Actions Build Status](https://github.com/js-joda/js-joda/actions/workflows/tests.yaml/badge.svg?branch=main)](https://github.com/js-joda/js-joda/actions)
5
5
  [![Sauce Test Status](https://saucelabs.com/buildstatus/js-joda)](https://saucelabs.com/u/js-joda)
6
- [![Coverage Status](https://coveralls.io/repos/js-joda/js-joda/badge.svg?branch=master&service=github)](https://coveralls.io/github/js-joda/js-joda?branch=master)
6
+ [![Coverage Status](https://coveralls.io/repos/js-joda/js-joda/badge.svg?branch=main&service=github)](https://coveralls.io/github/js-joda/js-joda?branch=main)
7
7
  [![Downloads/Month](https://img.shields.io/npm/dm/%40js-joda%2Fcore.svg)](https://img.shields.io/npm/dm/%40js-joda%2Fcore.svg)
8
8
 
9
- [![Sauce Browser Matrix](https://saucelabs.com/browser-matrix/js-joda.svg?branch=master)](https://saucelabs.com/u/js-joda)
9
+ [![Sauce Browser Matrix](https://saucelabs.com/browser-matrix/js-joda.svg?branch=main&42)](https://saucelabs.com/u/js-joda)
10
10
 
11
11
  ## Introduction
12
12
 
@@ -100,12 +100,12 @@ js-joda consist of four packages:
100
100
 
101
101
  | package name | description | path |
102
102
  |---|---|---|
103
- | `@js-joda/core` | Implementation of the ThreeTen Classes and API | [/packages/core](//github.com/js-joda/js-joda/tree/master/packages/core) |
104
- | `@js-joda/timezone` | Implementation of timezone calculation based on the iana Time Zone Database | [/packages/timezone](//github.com/js-joda/js-joda/tree/master/packages/timezone) |
105
- | `@js-joda/locale` | Implementation of locale specific functionality for js-joda, especially for formatting and parsing locale specific dates | [/packages/locale](//github.com/js-joda/js-joda/tree/master/packages/locale) |
106
- | `@js-joda/extra` | Implementation of the ThreeTen-Extra Classes and API |[/packages/extra](//github.com/js-joda/js-joda/tree/master/packages/extra) |
103
+ | `@js-joda/core` | Implementation of the ThreeTen Classes and API | [/packages/core](//github.com/js-joda/js-joda/tree/main/packages/core) |
104
+ | `@js-joda/timezone` | Implementation of timezone calculation based on the iana Time Zone Database | [/packages/timezone](//github.com/js-joda/js-joda/tree/main/packages/timezone) |
105
+ | `@js-joda/locale` | Implementation of locale specific functionality for js-joda, especially for formatting and parsing locale specific dates | [/packages/locale](//github.com/js-joda/js-joda/tree/main/packages/locale) |
106
+ | `@js-joda/extra` | Implementation of the ThreeTen-Extra Classes and API |[/packages/extra](//github.com/js-joda/js-joda/tree/main/packages/extra) |
107
107
 
108
- The [@js-joda/examples](//github.com/js-joda/js-joda/tree/master/packages/examples) package is for testing the different build artifacts in different context, like webpack, browser node, etc.
108
+ The [@js-joda/examples](//github.com/js-joda/js-joda/tree/main/packages/examples) package is for testing the different build artifacts in different context, like webpack, browser node, etc.
109
109
 
110
110
  ## Documentation
111
111
 
@@ -123,7 +123,7 @@ Note that only pull requests and issues that match the threeten backport API wil
123
123
 
124
124
  ## License
125
125
 
126
- - `js-joda` is released under the [BSD 3-clause license](//github.com/js-joda/js-joda/blob/master/LICENSE).
126
+ - `js-joda` is released under the [BSD 3-clause license](//github.com/js-joda/js-joda/blob/main/LICENSE).
127
127
 
128
128
  - `js-joda` uses the ThreeTen-Backport implementation (http://www.threeten.org/threetenbp/) as a reference base for implementation. This allows us to release js-joda under the BSD License while the OpenJDK java.time implementation is under GNU GPL+linking exception. The API of the ThreeTen-Backport is mostly identical to the official Java SE 8 API from the view of our JavaScript port.
129
129
 
@@ -146,14 +146,14 @@ are just copied but never equalled.
146
146
  ### Milestone 2: IANA timezone support (reached with version v1.2.0)
147
147
 
148
148
  - Add IANA timezone database support to js-joda. Implement handling of daylight saving transitions, mainly in `ZonedDateTime`.
149
- - For access to the IANA timezone database, the plugin [@js-joda/timezone](//github.com/js-joda/js-joda/tree/master/packages/timezone) is required. It provides an implementation of the [ZoneRulesProvider](//js-joda.github.io/js-joda/class/packages/core/src/zone/ZoneRulesProvider.js~ZoneRulesProvider.html) and contains the iana timezone database.
149
+ - For access to the IANA timezone database, the plugin [@js-joda/timezone](//github.com/js-joda/js-joda/tree/main/packages/timezone) is required. It provides an implementation of the [ZoneRulesProvider](//js-joda.github.io/js-joda/class/packages/core/src/zone/ZoneRulesProvider.js~ZoneRulesProvider.html) and contains the iana timezone database.
150
150
 
151
151
  ### Milestone 3: Locale support (reached with v2.0.0 of @js-joda/locale)
152
152
 
153
153
  - Add locale support.
154
154
  - Extend pattern parser/ formatter for text with locale support.
155
155
 
156
- see the plugin [@js-joda/locale](//github.com/js-joda/js-joda/tree/master/packages/locale)
156
+ see the plugin [@js-joda/locale](//github.com/js-joda/js-joda/tree/main/packages/locale)
157
157
 
158
158
  ### Future Milestones
159
159
 
@@ -1,4 +1,4 @@
1
- //! @version @js-joda/core - 5.3.2
1
+ //! @version @js-joda/core - 5.4.1
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)
@@ -1335,7 +1335,7 @@ var ChronoField = function (_TemporalField) {
1335
1335
  };
1336
1336
 
1337
1337
  _proto.isDateBased = function isDateBased() {
1338
- var dateBased = this === ChronoField.DAY_OF_WEEK || this === ChronoField.ALIGNED_DAY_OF_WEEK_IN_MONTH || this === ChronoField.ALIGNED_DAY_OF_WEEK_IN_YEAR || this === ChronoField.DAY_OF_MONTH || this === ChronoField.DAY_OF_YEAR || this === ChronoField.EPOCH_DAY || this === ChronoField.ALIGNED_WEEK_OF_MONTH || this === ChronoField.ALIGNED_WEEK_OF_YEAR || this === ChronoField.MONTH_OF_YEAR || this === ChronoField.YEAR_OF_ERA || this === ChronoField.YEAR || this === ChronoField.ERA;
1338
+ var dateBased = this === ChronoField.DAY_OF_WEEK || this === ChronoField.ALIGNED_DAY_OF_WEEK_IN_MONTH || this === ChronoField.ALIGNED_DAY_OF_WEEK_IN_YEAR || this === ChronoField.DAY_OF_MONTH || this === ChronoField.DAY_OF_YEAR || this === ChronoField.EPOCH_DAY || this === ChronoField.ALIGNED_WEEK_OF_MONTH || this === ChronoField.ALIGNED_WEEK_OF_YEAR || this === ChronoField.MONTH_OF_YEAR || this === ChronoField.PROLEPTIC_MONTH || this === ChronoField.YEAR_OF_ERA || this === ChronoField.YEAR || this === ChronoField.ERA;
1339
1339
  return dateBased;
1340
1340
  };
1341
1341
 
@@ -1391,7 +1391,7 @@ function _init$k() {
1391
1391
  ChronoField.ALIGNED_DAY_OF_WEEK_IN_YEAR = new ChronoField('AlignedDayOfWeekInYear', ChronoUnit.DAYS, ChronoUnit.WEEKS, ValueRange.of(1, 7));
1392
1392
  ChronoField.DAY_OF_MONTH = new ChronoField('DayOfMonth', ChronoUnit.DAYS, ChronoUnit.MONTHS, ValueRange.of(1, 28, 31), 'day');
1393
1393
  ChronoField.DAY_OF_YEAR = new ChronoField('DayOfYear', ChronoUnit.DAYS, ChronoUnit.YEARS, ValueRange.of(1, 365, 366));
1394
- ChronoField.EPOCH_DAY = new ChronoField('EpochDay', ChronoUnit.DAYS, ChronoUnit.FOREVER, ValueRange.of(Math.floor(YearConstants.MIN_VALUE * 365.25), Math.floor(YearConstants.MAX_VALUE * 365.25)));
1394
+ ChronoField.EPOCH_DAY = new ChronoField('EpochDay', ChronoUnit.DAYS, ChronoUnit.FOREVER, ValueRange.of(-365961662, 364522971));
1395
1395
  ChronoField.ALIGNED_WEEK_OF_MONTH = new ChronoField('AlignedWeekOfMonth', ChronoUnit.WEEKS, ChronoUnit.MONTHS, ValueRange.of(1, 4, 5));
1396
1396
  ChronoField.ALIGNED_WEEK_OF_YEAR = new ChronoField('AlignedWeekOfYear', ChronoUnit.WEEKS, ChronoUnit.YEARS, ValueRange.of(1, 53));
1397
1397
  ChronoField.MONTH_OF_YEAR = new ChronoField('MonthOfYear', ChronoUnit.MONTHS, ChronoUnit.YEARS, ValueRange.of(1, 12), 'month');
@@ -7624,16 +7624,16 @@ var YearMonth = function (_Temporal) {
7624
7624
  return monthsUntil;
7625
7625
 
7626
7626
  case ChronoUnit.YEARS:
7627
- return monthsUntil / 12;
7627
+ return MathUtil.intDiv(monthsUntil, 12);
7628
7628
 
7629
7629
  case ChronoUnit.DECADES:
7630
- return monthsUntil / 120;
7630
+ return MathUtil.intDiv(monthsUntil, 120);
7631
7631
 
7632
7632
  case ChronoUnit.CENTURIES:
7633
- return monthsUntil / 1200;
7633
+ return MathUtil.intDiv(monthsUntil, 1200);
7634
7634
 
7635
7635
  case ChronoUnit.MILLENNIA:
7636
- return monthsUntil / 12000;
7636
+ return MathUtil.intDiv(monthsUntil, 12000);
7637
7637
 
7638
7638
  case ChronoUnit.ERAS:
7639
7639
  return end.getLong(ChronoField.ERA) - this.getLong(ChronoField.ERA);
@@ -8722,22 +8722,22 @@ var OffsetTime = function (_Temporal) {
8722
8722
  return nanosUntil;
8723
8723
 
8724
8724
  case ChronoUnit.MICROS:
8725
- return Math.floor(nanosUntil / 1000);
8725
+ return MathUtil.intDiv(nanosUntil, 1000);
8726
8726
 
8727
8727
  case ChronoUnit.MILLIS:
8728
- return Math.floor(nanosUntil / 1000000);
8728
+ return MathUtil.intDiv(nanosUntil, 1000000);
8729
8729
 
8730
8730
  case ChronoUnit.SECONDS:
8731
- return Math.floor(nanosUntil / LocalTime.NANOS_PER_SECOND);
8731
+ return MathUtil.intDiv(nanosUntil, LocalTime.NANOS_PER_SECOND);
8732
8732
 
8733
8733
  case ChronoUnit.MINUTES:
8734
- return Math.floor(nanosUntil / LocalTime.NANOS_PER_MINUTE);
8734
+ return MathUtil.intDiv(nanosUntil, LocalTime.NANOS_PER_MINUTE);
8735
8735
 
8736
8736
  case ChronoUnit.HOURS:
8737
- return Math.floor(nanosUntil / LocalTime.NANOS_PER_HOUR);
8737
+ return MathUtil.intDiv(nanosUntil, LocalTime.NANOS_PER_HOUR);
8738
8738
 
8739
8739
  case ChronoUnit.HALF_DAYS:
8740
- return Math.floor(nanosUntil / (12 * LocalTime.NANOS_PER_HOUR));
8740
+ return MathUtil.intDiv(nanosUntil, 12 * LocalTime.NANOS_PER_HOUR);
8741
8741
  }
8742
8742
 
8743
8743
  throw new UnsupportedTemporalTypeException("Unsupported unit: " + unit);