@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.
- package/CHANGELOG.md +32 -1
- package/README.md +43 -36
- package/dist/js-joda.d.ts +241 -179
- package/dist/js-joda.esm.js +11524 -10214
- package/dist/js-joda.js +11524 -10214
- package/dist/js-joda.js.map +1 -1
- package/dist/js-joda.min.js +2 -2
- package/package.json +10 -40
- package/src/Clock.js +8 -9
- package/src/DayOfWeek.js +14 -14
- package/src/Duration.js +15 -15
- package/src/Instant.js +40 -74
- package/src/LocalDate.js +71 -93
- package/src/LocalDateTime.js +25 -68
- package/src/LocalTime.js +27 -72
- package/src/MathUtil.js +3 -3
- package/src/Month.js +13 -13
- package/src/MonthDay.js +25 -25
- package/src/OffsetDateTime.js +29 -29
- package/src/OffsetTime.js +32 -32
- package/src/Period.js +12 -12
- package/src/StringUtil.js +1 -1
- package/src/Year.js +33 -115
- package/src/YearMonth.js +31 -113
- package/src/ZoneId.js +7 -7
- package/src/ZoneIdFactory.js +14 -14
- package/src/ZoneOffset.js +23 -23
- package/src/ZoneRegion.js +2 -2
- package/src/ZonedDateTime.js +31 -74
- package/src/_init.js +24 -24
- package/src/assert.js +31 -4
- package/src/chrono/ChronoLocalDate.js +8 -8
- package/src/chrono/ChronoLocalDateTime.js +10 -10
- package/src/chrono/ChronoZonedDateTime.js +8 -8
- package/src/chrono/IsoChronology.js +13 -13
- package/src/convert.js +12 -8
- package/src/errors.js +3 -3
- package/src/format/DateTimeBuilder.js +17 -17
- package/src/format/DateTimeFormatter.js +45 -24
- package/src/format/DateTimeFormatterBuilder.js +59 -59
- package/src/format/DateTimeParseContext.js +6 -6
- package/src/format/DateTimePrintContext.js +3 -3
- package/src/format/DecimalStyle.js +1 -1
- package/src/format/ResolverStyle.js +1 -1
- package/src/format/SignStyle.js +1 -1
- package/src/format/TextStyle.js +1 -1
- package/src/format/parser/CharLiteralPrinterParser.js +3 -3
- package/src/format/parser/FractionPrinterParser.js +10 -10
- package/src/format/parser/NumberPrinterParser.js +18 -18
- package/src/format/parser/OffsetIdPrinterParser.js +9 -9
- package/src/format/parser/PadPrinterParserDecorator.js +3 -3
- package/src/format/parser/StringLiteralPrinterParser.js +2 -2
- package/src/format/parser/ZoneIdPrinterParser.js +5 -5
- package/src/js-joda.js +5 -0
- package/src/temporal/ChronoField.js +5 -5
- package/src/temporal/ChronoUnit.js +6 -6
- package/src/temporal/IsoFields.js +12 -12
- package/src/temporal/NativeJsTemporal.js +11 -11
- package/src/temporal/Temporal.js +45 -38
- package/src/temporal/TemporalAccessor.js +14 -4
- package/src/temporal/TemporalAdjuster.js +1 -1
- package/src/temporal/TemporalAdjusters.js +6 -6
- package/src/temporal/TemporalAmount.js +1 -1
- package/src/temporal/TemporalQueriesFactory.js +6 -6
- package/src/temporal/TemporalQuery.js +4 -2
- package/src/temporal/TemporalUnit.js +1 -1
- package/src/temporal/ValueRange.js +15 -15
- package/src/use.js +6 -1
- package/src/zone/SystemDefaultZoneId.js +2 -2
- package/src/zone/SystemDefaultZoneRules.js +3 -3
- package/src/zone/ZoneOffsetTransition.js +7 -7
- package/src/zone/ZoneRules.js +4 -4
- package/src/zone/ZoneRulesProvider.js +2 -2
- package/src/temporal/DefaultInterfaceTemporal.js +0 -118
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,37 @@ Changelog
|
|
|
3
3
|
|
|
4
4
|
### next (upcoming)
|
|
5
5
|
|
|
6
|
+
### 4.2.1
|
|
7
|
+
|
|
8
|
+
* [#559](https://github.com/js-joda/js-joda/pull/559) Fix references to deprecated single repos ([@pithu](https://github.com/pithu))
|
|
9
|
+
|
|
10
|
+
### 4.2.0
|
|
11
|
+
|
|
12
|
+
* Upgrade dependencies #555 by @pithu
|
|
13
|
+
* Change @babel/preset-env targets, fix IE11 issues #555 by @pithu
|
|
14
|
+
* Improve documentation #556 by @pithu
|
|
15
|
+
|
|
16
|
+
### 4.1.0
|
|
17
|
+
|
|
18
|
+
* Remove edge case handling for Temporal.minus #542 by @pithu
|
|
19
|
+
* Improve docu #550 by @pithu
|
|
20
|
+
|
|
21
|
+
### 4.0.0
|
|
22
|
+
|
|
23
|
+
Even this is a major release, there are no real breaking changes.
|
|
24
|
+
The release contains typescript definition cleanup and some
|
|
25
|
+
"private" methods have been prefixed with "_". These methods are intended for internal use only.
|
|
26
|
+
|
|
27
|
+
If you used the threeten API in the intended way, there shouldn't be any breaking changes.
|
|
28
|
+
If you used internal methods before, there is an replacement eg instead of `minusAmountUnit` use `minus`.
|
|
29
|
+
|
|
30
|
+
* cleanup TS Typings in #456 by @InExtremaRes
|
|
31
|
+
* cleanup private methods and Temporal class in #460 by @InExtremaRes
|
|
32
|
+
* remove TS definitions from core, moved to locale TS definitions in #389 by @InExtremaRes
|
|
33
|
+
* make .equals a type predicate in the TS typings in #457 by @InExtremaRes
|
|
34
|
+
* add some ISO formatters in #455 by @akonior
|
|
35
|
+
* several dependabot updates
|
|
36
|
+
|
|
6
37
|
### 3.2.0
|
|
7
38
|
|
|
8
39
|
* add typescript definitions for OffsetDateTime and OffsetTime #448 by jonfreedman
|
|
@@ -290,7 +321,7 @@ Resolve those conflicts by using the 'public shorthand' methods, like instead of
|
|
|
290
321
|
|
|
291
322
|
#### Add ZoneRulesProvider stub
|
|
292
323
|
|
|
293
|
-
Add the ZoneRulesProvider. This should be the last step to enable js-joda for an external js-joda
|
|
324
|
+
Add the ZoneRulesProvider. This should be the last step to enable js-joda for an external @js-joda/timezone plugin.
|
|
294
325
|
|
|
295
326
|
#### Provide a way to extend js-joda
|
|
296
327
|
|
package/README.md
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
# @js-joda/core
|
|
2
|
-
|
|
3
1
|
# Immutable date and time library for JavaScript
|
|
4
2
|
|
|
5
3
|
[](https://badge.fury.io/js/%40js-joda%2Fcore)
|
|
6
|
-
[](https://app.travis-ci.com/js-joda/js-joda)
|
|
7
5
|
[](https://saucelabs.com/u/js-joda)
|
|
8
6
|
[](https://coveralls.io/github/js-joda/js-joda?branch=master)
|
|
9
|
-
[](https://img.shields.io/npm/dm/%40js-joda%2Fcore.svg)
|
|
8
|
+
|
|
9
|
+
[](https://saucelabs.com/u/js-joda)
|
|
11
10
|
|
|
12
11
|
## Introduction
|
|
13
12
|
|
|
@@ -19,7 +18,7 @@
|
|
|
19
18
|
|
|
20
19
|
- js-joda comes with built-in parsers/ formatters for ISO 8601 as specified in RFC 3339, that can be easily customized.
|
|
21
20
|
|
|
22
|
-
- js-joda supports **ECMAScript 5** browsers down to
|
|
21
|
+
- js-joda supports **ECMAScript 5** browsers down to IE11.
|
|
23
22
|
|
|
24
23
|
- js-joda is a **port of the threeten** backport, which is the base for JSR-310 implementation of the Java SE 8 java.time package. Threeten is inspired by **Joda-Time**, having similar concepts and the same author.
|
|
25
24
|
|
|
@@ -95,11 +94,48 @@ To use js-joda from a browser, download either `dist/js-joda.min.js` or `dist/js
|
|
|
95
94
|
</script>
|
|
96
95
|
```
|
|
97
96
|
|
|
97
|
+
## js-joda packages
|
|
98
|
+
|
|
99
|
+
js-joda consist of four packages:
|
|
100
|
+
|
|
101
|
+
| package name | description | path |
|
|
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) |
|
|
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.
|
|
109
|
+
|
|
98
110
|
## Documentation
|
|
99
111
|
|
|
100
112
|
- [js-joda Quick start guide](//js-joda.github.io/js-joda/manual/getting-started.html) Quick start guide and examples
|
|
101
113
|
- [API](//js-joda.github.io/js-joda/identifiers.html) ESDoc generated API documentation
|
|
102
114
|
|
|
115
|
+
## Contributing
|
|
116
|
+
|
|
117
|
+
Contributions are always welcome. Before contributing please read the [code of conduct](http://contributor-covenant.org/version/1/4/) &
|
|
118
|
+
search the issue tracker. We use GitHub issues. Your issue may have already been discussed or fixed. To contribute, fork js-joda, commit your changes, & send a pull request.
|
|
119
|
+
|
|
120
|
+
By contributing to js-joda, you agree that your contributions will be licensed under its BSD license.
|
|
121
|
+
|
|
122
|
+
Note that only pull requests and issues that match the threeten backport API will be considered. Additional requested features will be rejected.
|
|
123
|
+
|
|
124
|
+
## License
|
|
125
|
+
|
|
126
|
+
- `js-joda` is released under the [BSD 3-clause license](//github.com/js-joda/js-joda/blob/master/LICENSE).
|
|
127
|
+
|
|
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
|
+
|
|
130
|
+
- Our implementation reference base ThreeTen-Backport (http://www.threeten.org/threetenbp/) is also released under the BSD 3-clause license
|
|
131
|
+
|
|
132
|
+
- `OpenJDK` is under GNU GPL+linking exception.
|
|
133
|
+
|
|
134
|
+
- The author of `Joda-Time` and the lead architect of the JSR-310 is Stephen Colebourne.
|
|
135
|
+
|
|
136
|
+
The API of this project (as far as possible with JavaScript), a lot of implementation details and documentation
|
|
137
|
+
are just copied but never equalled.
|
|
138
|
+
|
|
103
139
|
## Roadmap
|
|
104
140
|
|
|
105
141
|
### Milestone 1: Core domains (reached with version v1.0.0)
|
|
@@ -112,7 +148,7 @@ To use js-joda from a browser, download either `dist/js-joda.min.js` or `dist/js
|
|
|
112
148
|
- Add IANA timezone database support to js-joda. Implement handling of daylight saving transitions, mainly in `ZonedDateTime`.
|
|
113
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.
|
|
114
150
|
|
|
115
|
-
### Milestone 3: Locale support (reached with v2.0.0 of js-joda
|
|
151
|
+
### Milestone 3: Locale support (reached with v2.0.0 of @js-joda/locale)
|
|
116
152
|
|
|
117
153
|
- Add locale support.
|
|
118
154
|
- Extend pattern parser/ formatter for text with locale support.
|
|
@@ -124,32 +160,3 @@ see the plugin [@js-joda/locale](//github.com/js-joda/js-joda/tree/master/packag
|
|
|
124
160
|
- Reduce library size by removing redundant code, especially by refactoring code for formatting/ parsing dates.
|
|
125
161
|
- Increase test coverage (ongoing task)
|
|
126
162
|
- Cleanup documentation (ongoing task)
|
|
127
|
-
- Improve static factory API design and make it more JavaScript style. One idea is to remove static factory methods like parse, from, of and unify it to one factory method per domain. E.g. localDate(isoDate: string), localDate(year: number, month: number, dayOfMonth: number)
|
|
128
|
-
- Merge methods get and getLong (difference between `int` and `long` values makes no sense with JavaScript)
|
|
129
|
-
- Simplify temporal adjusters (amount, etc) by using functions instead of classes or objects
|
|
130
|
-
|
|
131
|
-
## Contributing
|
|
132
|
-
|
|
133
|
-
Contributions are always welcome. Before contributing please read the [code of conduct](http://contributor-covenant.org/version/1/4/) &
|
|
134
|
-
search the issue tracker. We use GitHub issues. Your issue may have already been discussed or fixed. To contribute, fork js-joda, commit your changes, & send a pull request.
|
|
135
|
-
|
|
136
|
-
By contributing to js-joda, you agree that your contributions will be licensed under its BSD license.
|
|
137
|
-
|
|
138
|
-
Note that only pull requests and issues that match the threeten backport API will be considered. Additional requested features will be rejected.
|
|
139
|
-
|
|
140
|
-
## License
|
|
141
|
-
|
|
142
|
-
- `Joda-Time` is the base for JSR-310 that became part of Java SE 8 in the java.time package. JSR-310 is a new implementation with an API 'inspired by Joda-Time' but improves on some design flaws (see http://blog.joda.org/2009/11/why-jsr-310-isn-joda-time_4941.html) `Joda-Time` is under Apache 2.0 licence.
|
|
143
|
-
|
|
144
|
-
`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.
|
|
145
|
-
|
|
146
|
-
- `js-joda` is released under the [BSD 3-clause license](//github.com/js-joda/js-joda/blob/master/LICENSE).
|
|
147
|
-
|
|
148
|
-
- Our implementation reference base ThreeTen-Backport (http://www.threeten.org/threetenbp/) is also released under the BSD 3-clause license
|
|
149
|
-
|
|
150
|
-
- `OpenJDK` is under GNU GPL+linking exception.
|
|
151
|
-
|
|
152
|
-
- The author of `Joda-Time` and the lead architect of the JSR-310 is Stephen Colebourne.
|
|
153
|
-
|
|
154
|
-
The API of this project (as far as possible with JavaScript), a lot of implementation details and documentation
|
|
155
|
-
are just copied but never equalled.
|