Skip to content

armgit / core

Public Imported from GitHub
0

100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps

Replace moment-timezone with Intl.supportedValuesOf (#2428)

Koen787b7e668956
diff --git a/ui/component/or-json-forms/package.json b/ui/component/or-json-forms/package.json
index f3fb08776..b51fd349e 100644
--- a/ui/component/or-json-forms/package.json
+++ b/ui/component/or-json-forms/package.json
@@ -28,8 +28,7 @@
"@openremote/or-mwc-components": "workspace:*",
"@openremote/or-translate": "workspace:*",
"ajv": "^8.8.2",
- "lit": "^3.3.1",
- "moment-timezone": "0.6.0"
+ "lit": "^3.3.1"
},
"publishConfig": {
"access": "public"
diff --git a/ui/component/or-json-forms/src/controls/control-input-element.ts b/ui/component/or-json-forms/src/controls/control-input-element.ts
index a83e5e447..3137e0a40 100644
--- a/ui/component/or-json-forms/src/controls/control-input-element.ts
+++ b/ui/component/or-json-forms/src/controls/control-input-element.ts
@@ -13,7 +13,6 @@ import {
JsonSchema
} from "@jsonforms/core";
import {isEnumArray} from "../standard-renderers";
-import moment from "moment-timezone";
let defaultTz: string;
@@ -132,7 +131,7 @@ export class ControlInputElement extends ControlBaseElement {
this.inputType = InputType.PASSWORD;
} else if (format === "timezone") {
this.inputType = InputType.SELECT;
- options = moment.tz.names().map(z => [z, z]);
+ options = Intl.supportedValuesOf("timeZone").map(z => [z, z]);
if (!(defaultTz && value)) {
defaultTz = Intl.DateTimeFormat().resolvedOptions().timeZone;
this.handleChange(this.path, defaultTz);
diff --git a/ui/tsconfig.json b/ui/tsconfig.json
index da0e8c0b0..9248e852e 100644
--- a/ui/tsconfig.json
+++ b/ui/tsconfig.json
@@ -8,7 +8,8 @@
"dom",
"es2017",
"es2019",
- "es2021"
+ "es2021",
+ "es2022"
],
"strict": true,
"declaration": true,
diff --git a/yarn.lock b/yarn.lock
index cbde4e6f8..53d780b40 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -2143,7 +2143,6 @@ __metadata:
"@openremote/or-translate": "workspace:*"
ajv: "npm:^8.8.2"
lit: "npm:^3.3.1"
- moment-timezone: "npm:0.6.0"
languageName: unknown
linkType: soft
@@ -8801,15 +8800,6 @@ __metadata:
languageName: node
linkType: hard
-"moment-timezone@npm:0.6.0":
- version: 0.6.0
- resolution: "moment-timezone@npm:0.6.0"
- dependencies:
- moment: "npm:^2.29.4"
- checksum: 10c0/16164cf321d8be0bf7d43855286b426c94c8200e0634f2e42cf469f591c6a230ac43f37d3826d76b05ac221f69a571400323fb8625e3d4e8669f4d9ab00fe779
- languageName: node
- linkType: hard
-
"moment@npm:2.29.4":
version: 2.29.4
resolution: "moment@npm:2.29.4"