@js-joda/timezone 2.26.0 → 3.0.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.
Files changed (46) hide show
  1. package/README.md +39 -9
  2. package/dist/js-joda-timezone-10-year-range.esm.js +459 -709
  3. package/dist/js-joda-timezone-10-year-range.esm.js.map +1 -1
  4. package/dist/js-joda-timezone-10-year-range.js +459 -709
  5. package/dist/js-joda-timezone-10-year-range.js.map +1 -1
  6. package/dist/js-joda-timezone-10-year-range.min.js +2 -2
  7. package/dist/js-joda-timezone-300-year-range.esm.js +996 -0
  8. package/dist/js-joda-timezone-300-year-range.esm.js.map +1 -0
  9. package/dist/js-joda-timezone-300-year-range.js +1002 -0
  10. package/dist/js-joda-timezone-300-year-range.js.map +1 -0
  11. package/dist/js-joda-timezone-300-year-range.min.js +5 -0
  12. package/dist/js-joda-timezone-4-year-range.esm.js +12 -12
  13. package/dist/js-joda-timezone-4-year-range.js +12 -12
  14. package/dist/js-joda-timezone-4-year-range.min.js +2 -2
  15. package/dist/js-joda-timezone-60-year-range.esm.js +10 -10
  16. package/dist/js-joda-timezone-60-year-range.js +10 -10
  17. package/dist/js-joda-timezone-60-year-range.min.js +2 -2
  18. package/dist/js-joda-timezone-empty.esm.js +1 -1
  19. package/dist/js-joda-timezone-empty.js +1 -1
  20. package/dist/js-joda-timezone-empty.min.js +1 -1
  21. package/dist/js-joda-timezone-lifetime-range.esm.js +996 -0
  22. package/dist/js-joda-timezone-lifetime-range.esm.js.map +1 -0
  23. package/dist/js-joda-timezone-lifetime-range.js +1002 -0
  24. package/dist/js-joda-timezone-lifetime-range.js.map +1 -0
  25. package/dist/js-joda-timezone-lifetime-range.min.js +5 -0
  26. package/dist/js-joda-timezone.esm.js +376 -626
  27. package/dist/js-joda-timezone.esm.js.map +1 -1
  28. package/dist/js-joda-timezone.js +376 -626
  29. package/dist/js-joda-timezone.js.map +1 -1
  30. package/dist/js-joda-timezone.min.js +2 -2
  31. package/package.json +2 -3
  32. package/dist/js-joda-timezone-1970-2030.esm.js +0 -1246
  33. package/dist/js-joda-timezone-1970-2030.esm.js.map +0 -1
  34. package/dist/js-joda-timezone-1970-2030.js +0 -1252
  35. package/dist/js-joda-timezone-1970-2030.js.map +0 -1
  36. package/dist/js-joda-timezone-1970-2030.min.js +0 -5
  37. package/dist/js-joda-timezone-2012-2022.esm.js +0 -1246
  38. package/dist/js-joda-timezone-2012-2022.esm.js.map +0 -1
  39. package/dist/js-joda-timezone-2012-2022.js +0 -1252
  40. package/dist/js-joda-timezone-2012-2022.js.map +0 -1
  41. package/dist/js-joda-timezone-2012-2022.min.js +0 -5
  42. package/dist/js-joda-timezone-2017-2027.esm.js +0 -1246
  43. package/dist/js-joda-timezone-2017-2027.esm.js.map +0 -1
  44. package/dist/js-joda-timezone-2017-2027.js +0 -1252
  45. package/dist/js-joda-timezone-2017-2027.js.map +0 -1
  46. package/dist/js-joda-timezone-2017-2027.min.js +0 -5
package/README.md CHANGED
@@ -9,7 +9,8 @@
9
9
  ## Motivation
10
10
 
11
11
  Implementation of the js-joda ZoneRulesProvider, providing the
12
- bindings to the iana tzdb, using latest zone file generated by moment-timezone
12
+ bindings to the iana tzdb. The zone data is generated from the official IANA releases by
13
+ [@js-joda/tzdb-builder](../tzdb-builder) in this repository.
13
14
 
14
15
  The package doesn't export anything but it still has to be imported for side effects.
15
16
 
@@ -76,16 +77,44 @@ Install joda using npm
76
77
  </script>
77
78
 
78
79
  ## Reducing js-joda-timezone file size
79
- If you don't need all the historical data that @js-joda/timezone provides, you can instead use one of the reduced files ize builds:
80
+ If you don't need all the historical data that @js-joda/timezone provides, you can instead use one of the reduced file size builds.
81
+ Each one contains the data for a range of years relative to the year the data was generated.
82
+ The years below are for the data generated in 2026; the sizes are of the minified browser build.
80
83
 
81
- * `js-joda-timezone-10-year-range.js` covers +- five years from the current version's release
82
- * `js-joda-timezone-1970-2030.js` covers from 1970 to 2030
83
- * `js-joda-timezone-2012-2022.js` covers from 2012 to 2022 // deprecated, will be removed in future releases
84
- * `js-joda-timezone-2017-2027.js` covers from 2017 to 2027
84
+ | Bundle | Covers | Years (2026 data) | Size (min / gzip) |
85
+ |---|---|---|---|
86
+ | `js-joda-timezone` | all years | all | 708 KB / 35 KB |
87
+ | `js-joda-timezone-300-year-range` | ± 150 years | 1876 to 2176 | 331 KB / 29 KB |
88
+ | `js-joda-timezone-lifetime-range` | - 120 / + 15 years | 1906 to 2041 | 170 KB / 24 KB |
89
+ | `js-joda-timezone-60-year-range` | ± 30 years | 1996 to 2056 | 83 KB / 12 KB |
90
+ | `js-joda-timezone-10-year-range` | ± 5 years | 2021 to 2031 | 30 KB / 8 KB |
91
+ | `js-joda-timezone-4-year-range` | ± 2 years | 2024 to 2028 | 27 KB / 8 KB |
85
92
 
86
- To use one of these, just change your import path to the following format:
93
+ The `-lifetime-range` bundle covers the birth dates of all living people plus 15 years ahead, e.g. for websites that
94
+ handle birth dates. Note that a birth date stored as a `LocalDate` needs no time zone data at all; the bundle is only
95
+ needed when you convert birth date-times between zones or determine today's date in a zone.
87
96
 
88
- import '@js-joda/timezone/dist/js-joda-timezone-1970-2030'
97
+ Every bundle comes as CommonJS (`.js`), ES module (`.esm.js`) and minified UMD for the browser (`.min.js`).
98
+ To use one of them, change the import path, e.g.:
99
+
100
+ import '@js-joda/timezone/dist/js-joda-timezone-10-year-range'
101
+
102
+ or in the browser:
103
+
104
+ <script src="./packages/timezone/dist/js-joda-timezone-10-year-range.min.js"></script>
105
+
106
+ Things to keep in mind when you pick a range:
107
+
108
+ * Outside its range, a reduced bundle gives **wrong offsets without any error**: before the range it uses the
109
+ zone's first offset in the range, after it the zone's last one. For example, with the 4-year bundle,
110
+ `Europe/Berlin` in July 2035 resolves to `+01:00` instead of `+02:00`. Choose a range that covers every
111
+ date your application converts, including stored historical dates and future dates.
112
+ * The ranges move with the data: they are relative to the year a release's data was generated, not to the
113
+ year your application runs. An older `@js-joda/timezone` version covers fewer years into the future.
114
+ * All bundles contain the same zone IDs; zones whose rules are identical within the range are shared as links.
115
+
116
+ The fixed-year bundles `js-joda-timezone-1970-2030`, `-2012-2022` and `-2017-2027` have been removed,
117
+ use the `-lifetime-range` or `-300-year-range` bundle (with the 2026 data, both cover 1970 onwards; see the table above), the `-60-year-range` bundle or the full bundle instead.
89
118
 
90
119
  ## Implementation details
91
120
 
@@ -98,6 +127,7 @@ To use one of these, just change your import path to the following format:
98
127
 
99
128
  * The author of joda time and the lead architect of the JSR-310 is Stephen Colebourne.
100
129
 
101
- * The json versions of the iana tzdb are imported from and generated with [moment-timezone](https://github.com/moment/moment-timezone).
130
+ * The json versions of the iana tzdb are generated with [@js-joda/tzdb-builder](../tzdb-builder) from the [IANA time zone database](https://www.iana.org/time-zones).
131
+ The packed data format and its unpacking code originate from [moment-timezone](https://github.com/moment/moment-timezone) (MIT license).
102
132
 
103
133