diff --git a/package-lock.json b/package-lock.json index 9f2bce05..7578c191 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,6 +12,7 @@ "@grpc/grpc-js": "~1.7.3", "@louislam/ping": "~0.4.4-mod.1", "@louislam/sqlite3": "15.1.6", + "@vvo/tzdb": "^6.125.0", "args-parser": "~1.3.0", "axios": "~0.28.0", "axios-ntlm": "1.3.0", @@ -124,7 +125,6 @@ "stylelint-config-standard": "~25.0.0", "terser": "~5.15.0", "test": "~3.3.0", - "timezones-list": "~3.0.1", "typescript": "~4.4.4", "v-pagination-3": "~0.1.7", "vite": "~5.0.10", @@ -4672,6 +4672,11 @@ "vue": ">=3.2.0" } }, + "node_modules/@vvo/tzdb": { + "version": "6.125.0", + "resolved": "https://registry.npmjs.org/@vvo/tzdb/-/tzdb-6.125.0.tgz", + "integrity": "sha512-zxOP62q3CUYIIe6sL/IK6AhmhnPUuHPNx86qZTXuzQHo/QhQRTfXb331poUStTDdZgBoLc6BADUATbGGN/1d4A==" + }, "node_modules/abbrev": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", @@ -13303,12 +13308,6 @@ "node": ">=8" } }, - "node_modules/timezones-list": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/timezones-list/-/timezones-list-3.0.3.tgz", - "integrity": "sha512-C+Vdvvj2c1xB6pu81pOX8geo6mrk/QsudFVlTVQET7QQwu8WAIyhDNeCrK5grU7EMzmbKLWqz7uU6dN8fvQvPQ==", - "dev": true - }, "node_modules/to-fast-properties": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", diff --git a/package.json b/package.json index 0d2b1969..894079cf 100644 --- a/package.json +++ b/package.json @@ -77,6 +77,7 @@ "@grpc/grpc-js": "~1.7.3", "@louislam/ping": "~0.4.4-mod.1", "@louislam/sqlite3": "15.1.6", + "@vvo/tzdb": "^6.125.0", "args-parser": "~1.3.0", "axios": "~0.28.0", "axios-ntlm": "1.3.0", @@ -189,7 +190,6 @@ "stylelint-config-standard": "~25.0.0", "terser": "~5.15.0", "test": "~3.3.0", - "timezones-list": "~3.0.1", "typescript": "~4.4.4", "v-pagination-3": "~0.1.7", "vite": "~5.0.10", diff --git a/src/util-frontend.js b/src/util-frontend.js index 1e30160e..d9bf378e 100644 --- a/src/util-frontend.js +++ b/src/util-frontend.js @@ -1,5 +1,5 @@ import dayjs from "dayjs"; -import timezones from "timezones-list"; +import { getTimeZones } from "@vvo/tzdb"; import { localeDirection, currentLocale } from "./i18n"; import { POSITION } from "vue-toastification"; @@ -29,18 +29,19 @@ function getTimezoneOffset(timeZone) { */ export function timezoneList() { let result = []; + const timeZones = getTimeZones(); - for (let timezone of timezones) { + for (let timezone of timeZones) { try { - let display = dayjs().tz(timezone.tzCode).format("Z"); + let display = dayjs().tz(timezone.name).format("Z"); result.push({ - name: `(UTC${display}) ${timezone.tzCode}`, - value: timezone.tzCode, - time: getTimezoneOffset(timezone.tzCode), + name: `(UTC${display}) ${timezone.name}`, + value: timezone.name, + time: getTimezoneOffset(timezone.name), }); } catch (e) { - // Skipping not supported timezone.tzCode by dayjs + // Skipping not supported timezone.name by dayjs } }