diff --git a/package-lock.json b/package-lock.json index 3c7574668..b9206cd7c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,8 +9,8 @@ "version": "4.8.1", "license": "EPL-2.0", "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" }, "devDependencies": { @@ -1496,14 +1496,17 @@ } }, "node_modules/@js-joda/core": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/@js-joda/core/-/core-4.3.1.tgz", - "integrity": "sha512-oeaetlodcqVsiZDxnEcqsbs+sXBkASxua0mXs5OXuPQXz3/wdPTMlxwfQ4z2HKcOik3S9voW3QJkp/KLWDhvRQ==" + "version": "5.6.2", + "resolved": "https://registry.npmjs.org/@js-joda/core/-/core-5.6.2.tgz", + "integrity": "sha512-ow4R+7C24xeTjiMTTZ4k6lvxj7MRBqvqLCQjThQff3RjOmIMokMP20LNYVFhGafJtUx/Xo2Qp4qU8eNoTVH0SA==" }, "node_modules/@js-joda/timezone": { - "version": "2.11.1", - "resolved": "https://registry.npmjs.org/@js-joda/timezone/-/timezone-2.11.1.tgz", - "integrity": "sha512-lhO6la94pvUIOLF6DrIBg1YszsGEI9eIbznhROHooiFxGmLG6QumMTWYfR9gPwQGR/A1RPwUVLSkW8z16vLuWw==" + "version": "2.18.3", + "resolved": "https://registry.npmjs.org/@js-joda/timezone/-/timezone-2.18.3.tgz", + "integrity": "sha512-e+tZFIHWQJoR7ZVyGo5K/i+pPIAvFiEuq8F0CLFINSA7csSIK1dd4mtB2tb43e1/NUmDsnwo9FlhRlyBR9EzoQ==", + "peerDependencies": { + "@js-joda/core": ">=1.11.0" + } }, "node_modules/@jsdoc/salty": { "version": "0.2.1", @@ -10789,14 +10792,15 @@ } }, "@js-joda/core": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/@js-joda/core/-/core-4.3.1.tgz", - "integrity": "sha512-oeaetlodcqVsiZDxnEcqsbs+sXBkASxua0mXs5OXuPQXz3/wdPTMlxwfQ4z2HKcOik3S9voW3QJkp/KLWDhvRQ==" + "version": "5.6.2", + "resolved": "https://registry.npmjs.org/@js-joda/core/-/core-5.6.2.tgz", + "integrity": "sha512-ow4R+7C24xeTjiMTTZ4k6lvxj7MRBqvqLCQjThQff3RjOmIMokMP20LNYVFhGafJtUx/Xo2Qp4qU8eNoTVH0SA==" }, "@js-joda/timezone": { - "version": "2.11.1", - "resolved": "https://registry.npmjs.org/@js-joda/timezone/-/timezone-2.11.1.tgz", - "integrity": "sha512-lhO6la94pvUIOLF6DrIBg1YszsGEI9eIbznhROHooiFxGmLG6QumMTWYfR9gPwQGR/A1RPwUVLSkW8z16vLuWw==" + "version": "2.18.3", + "resolved": "https://registry.npmjs.org/@js-joda/timezone/-/timezone-2.18.3.tgz", + "integrity": "sha512-e+tZFIHWQJoR7ZVyGo5K/i+pPIAvFiEuq8F0CLFINSA7csSIK1dd4mtB2tb43e1/NUmDsnwo9FlhRlyBR9EzoQ==", + "requires": {} }, "@jsdoc/salty": { "version": "0.2.1", diff --git a/package.json b/package.json index 4085718fd..eb9475792 100644 --- a/package.json +++ b/package.json @@ -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": { diff --git a/src/time.js b/src/time.js index 768423e29..fe2f5bd91 100644 --- a/src/time.js +++ b/src/time.js @@ -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'); diff --git a/types/time.d.ts b/types/time.d.ts index 7fae1ccbd..a5d583a90 100644 --- a/types/time.d.ts +++ b/types/time.d.ts @@ -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; diff --git a/types/time.d.ts.map b/types/time.d.ts.map index 7e9bce4af..c739d06f0 100644 --- a/types/time.d.ts.map +++ b/types/time.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"time.d.ts","sourceRoot":"","sources":["../src/time.js"],"names":[],"mappings":";;;;;;;;;;IAAA;;;;;OAKG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6KH;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,mCAHa,KAAK,aAAa,CA4E9B;AAvKD;;;;;;;GAOG;AACH,mCAJW,MAAM,GACJ,KAAK,aAAa,CA0C9B;AAnFD;;;;;;;;;;;;GAYG;AACH,6CAHa,KAAK,aAAa,GAAC,IAAI,CAwBnC"} \ No newline at end of file +{"version":3,"file":"time.d.ts","sourceRoot":"","sources":["../src/time.js"],"names":[],"mappings":";;;;;;;;;;IAAA;;;;;OAKG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8KH;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,mCAHa,KAAK,aAAa,CA4E9B;AAvKD;;;;;;;GAOG;AACH,mCAJW,MAAM,GACJ,KAAK,aAAa,CA0C9B;AAnFD;;;;;;;;;;;;GAYG;AACH,6CAHa,KAAK,aAAa,GAAC,IAAI,CAwBnC"} \ No newline at end of file