Skip to content

Commit

Permalink
Upgrade js-joda (#323)
Browse files Browse the repository at this point in the history
Upgrade @js-joda/core from 4.3.1 to 5.6.2.
This includes a fix for js-joda/js-joda#689,
which has also been reported in #279.

Upgrade @js-joda/timezone from 2.11.2 to 2.18.3.
Also reduce timezone file size by not importing all the historical
timezone data, see
https://github.com/js-joda/js-joda/blob/main/packages/timezone/README.md#reducing-js-joda-timezone-file-size.

Signed-off-by: Florian Hotze <[email protected]>
  • Loading branch information
florian-h05 authored Mar 13, 2024
1 parent 308cca8 commit a626a71
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 19 deletions.
32 changes: 18 additions & 14 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
},
"homepage": "https://www.openhab.org/addons/automation/jsscripting/",
"dependencies": {
"@js-joda/core": "^4.3.1",
"@js-joda/timezone": "^2.11.1",
"@js-joda/core": "^5.6.2",
"@js-joda/timezone": "^2.18.3",
"parse-duration": "^0.1.1"
},
"scripts": {
Expand Down
3 changes: 2 additions & 1 deletion src/time.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
* @namespace time
*/

require('@js-joda/timezone');
// reduce timezone file size, see https://github.com/js-joda/js-joda/blob/main/packages/timezone/README.md#reducing-js-joda-timezone-file-size
require('@js-joda/timezone/dist/js-joda-timezone-10-year-range');
const time = require('@js-joda/core');

const log = require('./log')('time');
Expand Down
2 changes: 1 addition & 1 deletion types/time.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ declare const _exports: {
toZDT: typeof toZDT;
parseString: typeof _parseString;
parseISO8601: typeof _parseISO8601;
nativeJs(date: any, zone?: time.ZoneId): time.TemporalAccessor;
nativeJs(date: any, zone?: time.ZoneId): time.ZonedDateTime;
convert(temporal: time.LocalDate | time.Instant | time.ZonedDateTime | time.LocalDateTime, zone?: time.ZoneId): {
toDate: () => Date;
toEpochMilli: () => number;
Expand Down
2 changes: 1 addition & 1 deletion types/time.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a626a71

Please sign in to comment.