Skip to content

Commit

Permalink
Pull request: add etc timezones to the timezone list
Browse files Browse the repository at this point in the history
Updates AdguardTeam#6568

Squashed commit of the following:

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

    Merge branch 'master' into ADG-7953

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

    Merge branch 'master' into ADG-7953

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

    ADG-7953 add etc timezones to the timezones list
  • Loading branch information
IldarKamalov committed Dec 28, 2023
1 parent b42063e commit bec3cab
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 16 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Expand Up @@ -25,6 +25,7 @@ NOTE: Add new changes BELOW THIS COMMENT.

### Added

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

<!--
Expand Down
26 changes: 15 additions & 11 deletions client/package-lock.json

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

2 changes: 1 addition & 1 deletion client/package.json
Expand Up @@ -16,6 +16,7 @@
"@nivo/line": "^0.64.0",
"axios": "^0.19.2",
"classnames": "^2.2.6",
"countries-and-timezones": "^3.6.0",
"date-fns": "^1.29.0",
"i18next": "^19.6.2",
"i18next-browser-languagedetector": "^4.2.0",
Expand All @@ -42,7 +43,6 @@
"redux-actions": "^2.6.5",
"redux-form": "^8.3.5",
"redux-thunk": "^2.3.0",
"timezones-list": "^3.0.2",
"url-polyfill": "^1.1.9"
},
"devDependencies": {
Expand Down
10 changes: 6 additions & 4 deletions client/src/components/Filters/Services/ScheduleForm/Timezone.js
@@ -1,5 +1,5 @@
import React from 'react';
import timezones from 'timezones-list';
import ct from 'countries-and-timezones';
import { useTranslation } from 'react-i18next';
import PropTypes from 'prop-types';

Expand All @@ -15,6 +15,8 @@ export const Timezone = ({
setTimezone(event.target.value);
};

const timezones = ct.getAllTimezones();

return (
<div className="schedule__timezone">
<label className="form__label form__label--with-desc mb-2">
Expand All @@ -30,9 +32,9 @@ export const Timezone = ({
{t('schedule_timezone')}
</option>
{/* TODO: get timezones from backend method when the method is ready */}
{timezones.map((zone) => (
<option key={zone.name} value={zone.tzCode}>
{zone.label}
{Object.keys(timezones).map((zone) => (
<option key={zone} value={zone}>
{zone} (GMT{timezones[zone].utcOffsetStr})
</option>
))}
</select>
Expand Down

0 comments on commit bec3cab

Please sign in to comment.