Pull request: add etc timezones to the timezone list

Updates #6568

Squashed commit of the following:

commit cea0e9143eb1322d359fdb611ea7572431fef623
Merge: 6f4a5b162 b42063ee8
Author: Ildar Kamalov <ik@adguard.com>
Date:   Thu Dec 28 13:40:47 2023 +0300

    Merge branch 'master' into ADG-7953

commit 6f4a5b1629c2e9cffdc23292af8c1319fdd461f1
Merge: c574e3f52 d75712bb9
Author: Ildar Kamalov <ik@adguard.com>
Date:   Wed Dec 27 16:29:53 2023 +0300

    Merge branch 'master' into ADG-7953

commit c574e3f52a73f39044b333a2857a11a23ca997a8
Author: Ildar Kamalov <ik@adguard.com>
Date:   Wed Dec 27 09:52:20 2023 +0300

    ADG-7953 add etc timezones to the timezones list
This commit is contained in:
Ildar Kamalov 2023-12-28 16:27:01 +03:00
parent b42063ee86
commit bec3cab56c
4 changed files with 24 additions and 16 deletions

View File

@ -25,6 +25,7 @@ NOTE: Add new changes BELOW THIS COMMENT.
### Added ### Added
- Etc timezones to the timezone list ([#6568]).
- The schema version of the configuration file to the output of running - The schema version of the configuration file to the output of running
`AdGuardHome` (or `AdGuardHome.exe) with `-v --version` command-line options `AdGuardHome` (or `AdGuardHome.exe) with `-v --version` command-line options
([#6545]). ([#6545]).
@ -75,6 +76,7 @@ NOTE: Add new changes BELOW THIS COMMENT.
[#6534]: https://github.com/AdguardTeam/AdGuardHome/issues/6534 [#6534]: https://github.com/AdguardTeam/AdGuardHome/issues/6534
[#6541]: https://github.com/AdguardTeam/AdGuardHome/issues/6541 [#6541]: https://github.com/AdguardTeam/AdGuardHome/issues/6541
[#6545]: https://github.com/AdguardTeam/AdGuardHome/issues/6545 [#6545]: https://github.com/AdguardTeam/AdGuardHome/issues/6545
[#6568]: https://github.com/AdguardTeam/AdGuardHome/issues/6568
[#6584]: https://github.com/AdguardTeam/AdGuardHome/issues/6584 [#6584]: https://github.com/AdguardTeam/AdGuardHome/issues/6584
<!-- <!--

26
client/package-lock.json generated vendored
View File

@ -11,6 +11,7 @@
"@nivo/line": "^0.64.0", "@nivo/line": "^0.64.0",
"axios": "^0.19.2", "axios": "^0.19.2",
"classnames": "^2.2.6", "classnames": "^2.2.6",
"countries-and-timezones": "^3.6.0",
"date-fns": "^1.29.0", "date-fns": "^1.29.0",
"i18next": "^19.6.2", "i18next": "^19.6.2",
"i18next-browser-languagedetector": "^4.2.0", "i18next-browser-languagedetector": "^4.2.0",
@ -37,7 +38,6 @@
"redux-actions": "^2.6.5", "redux-actions": "^2.6.5",
"redux-form": "^8.3.5", "redux-form": "^8.3.5",
"redux-thunk": "^2.3.0", "redux-thunk": "^2.3.0",
"timezones-list": "^3.0.2",
"url-polyfill": "^1.1.9" "url-polyfill": "^1.1.9"
}, },
"devDependencies": { "devDependencies": {
@ -5596,6 +5596,15 @@
"node": ">=8" "node": ">=8"
} }
}, },
"node_modules/countries-and-timezones": {
"version": "3.6.0",
"resolved": "https://registry.npmjs.org/countries-and-timezones/-/countries-and-timezones-3.6.0.tgz",
"integrity": "sha512-8/nHBCs1eKeQ1jnsZVGdqrLYxS8nPcfJn8PnmxdJXWRLZdXsGFR8gnVhRjatGDBjqmPm7H+FtYpBYTPWd0Eiqg==",
"engines": {
"node": ">=8.x",
"npm": ">=5.x"
}
},
"node_modules/create-ecdh": { "node_modules/create-ecdh": {
"version": "4.0.3", "version": "4.0.3",
"resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.3.tgz", "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.3.tgz",
@ -18881,11 +18890,6 @@
"node": ">=0.6.0" "node": ">=0.6.0"
} }
}, },
"node_modules/timezones-list": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/timezones-list/-/timezones-list-3.0.2.tgz",
"integrity": "sha512-I698hm6Jp/xxkwyTSOr39pZkYKETL8LDJeSIhjxXBfPUAHM5oZNuQ4o9UK3PSkDBOkjATecSOBb3pR1IkIBUsg=="
},
"node_modules/tiny-invariant": { "node_modules/tiny-invariant": {
"version": "1.1.0", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.1.0.tgz", "resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.1.0.tgz",
@ -25268,6 +25272,11 @@
"yaml": "^1.7.2" "yaml": "^1.7.2"
} }
}, },
"countries-and-timezones": {
"version": "3.6.0",
"resolved": "https://registry.npmjs.org/countries-and-timezones/-/countries-and-timezones-3.6.0.tgz",
"integrity": "sha512-8/nHBCs1eKeQ1jnsZVGdqrLYxS8nPcfJn8PnmxdJXWRLZdXsGFR8gnVhRjatGDBjqmPm7H+FtYpBYTPWd0Eiqg=="
},
"create-ecdh": { "create-ecdh": {
"version": "4.0.3", "version": "4.0.3",
"resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.3.tgz", "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.3.tgz",
@ -35674,11 +35683,6 @@
"setimmediate": "^1.0.4" "setimmediate": "^1.0.4"
} }
}, },
"timezones-list": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/timezones-list/-/timezones-list-3.0.2.tgz",
"integrity": "sha512-I698hm6Jp/xxkwyTSOr39pZkYKETL8LDJeSIhjxXBfPUAHM5oZNuQ4o9UK3PSkDBOkjATecSOBb3pR1IkIBUsg=="
},
"tiny-invariant": { "tiny-invariant": {
"version": "1.1.0", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.1.0.tgz", "resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.1.0.tgz",

2
client/package.json vendored
View File

@ -16,6 +16,7 @@
"@nivo/line": "^0.64.0", "@nivo/line": "^0.64.0",
"axios": "^0.19.2", "axios": "^0.19.2",
"classnames": "^2.2.6", "classnames": "^2.2.6",
"countries-and-timezones": "^3.6.0",
"date-fns": "^1.29.0", "date-fns": "^1.29.0",
"i18next": "^19.6.2", "i18next": "^19.6.2",
"i18next-browser-languagedetector": "^4.2.0", "i18next-browser-languagedetector": "^4.2.0",
@ -42,7 +43,6 @@
"redux-actions": "^2.6.5", "redux-actions": "^2.6.5",
"redux-form": "^8.3.5", "redux-form": "^8.3.5",
"redux-thunk": "^2.3.0", "redux-thunk": "^2.3.0",
"timezones-list": "^3.0.2",
"url-polyfill": "^1.1.9" "url-polyfill": "^1.1.9"
}, },
"devDependencies": { "devDependencies": {

View File

@ -1,5 +1,5 @@
import React from 'react'; import React from 'react';
import timezones from 'timezones-list'; import ct from 'countries-and-timezones';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
@ -15,6 +15,8 @@ export const Timezone = ({
setTimezone(event.target.value); setTimezone(event.target.value);
}; };
const timezones = ct.getAllTimezones();
return ( return (
<div className="schedule__timezone"> <div className="schedule__timezone">
<label className="form__label form__label--with-desc mb-2"> <label className="form__label form__label--with-desc mb-2">
@ -30,9 +32,9 @@ export const Timezone = ({
{t('schedule_timezone')} {t('schedule_timezone')}
</option> </option>
{/* TODO: get timezones from backend method when the method is ready */} {/* TODO: get timezones from backend method when the method is ready */}
{timezones.map((zone) => ( {Object.keys(timezones).map((zone) => (
<option key={zone.name} value={zone.tzCode}> <option key={zone} value={zone}>
{zone.label} {zone} (GMT{timezones[zone].utcOffsetStr})
</option> </option>
))} ))}
</select> </select>