Skip to content

Commit 43b2744

Browse files
committed
Add Europe/Kyiv and Europe/Kiev
1 parent ea78f89 commit 43b2744

File tree

5 files changed

+13
-0
lines changed

5 files changed

+13
-0
lines changed

src/Constants/CountryAll.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ class CountryAll
7373
CountryEurope::COUNTRY_CODE_SE => CountryEurope::COUNTRY_NAME_SE,
7474
CountryEurope::COUNTRY_CODE_SI => CountryEurope::COUNTRY_NAME_SI,
7575
CountryEurope::COUNTRY_CODE_SK => CountryEurope::COUNTRY_NAME_SK,
76+
CountryEurope::COUNTRY_CODE_UA => CountryEurope::COUNTRY_NAME_UA,
7677
CountryEurope::COUNTRY_CODE_VA => CountryEurope::COUNTRY_NAME_VA,
7778

7879
/*

src/Constants/CountryEurope.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ class CountryEurope
4848
public const COUNTRY_CODE_SE = 'SE';
4949
public const COUNTRY_CODE_SI = 'SI';
5050
public const COUNTRY_CODE_SK = 'SK';
51+
public const COUNTRY_CODE_UA = 'UA';
5152
public const COUNTRY_CODE_VA = 'VA';
5253

5354
/*
@@ -145,6 +146,10 @@ class CountryEurope
145146
Language::DE_DE => 'Slowakei',
146147
Language::EN_GB => 'Slovakia',
147148
];
149+
public const COUNTRY_NAME_UA = [
150+
Language::DE_DE => 'Ukraine',
151+
Language::EN_GB => 'Ukraine',
152+
];
148153
public const COUNTRY_NAME_VA = [
149154
Language::DE_DE => 'Vatikanstadt',
150155
Language::EN_GB => 'Vatican City',

src/Timezone.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ public function getCountryCode(): string
4949
return CountryUnknown::COUNTRY_CODE_IV;
5050
}
5151

52+
if ($this->timezone === 'Europe/Kyiv') {
53+
$this->timezone = 'Europe/Kiev';
54+
}
55+
5256
try {
5357
$dateTimeZone = new DateTimeZone($this->timezone);
5458
$location = $dateTimeZone->getLocation();

tests/Unit/CountryTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ public function dataProvider(): array
137137
[++$number, 'getName', null, CountryEurope::COUNTRY_CODE_SE, CountryEurope::COUNTRY_NAME_SE[Language::EN_GB]],
138138
[++$number, 'getName', null, CountryEurope::COUNTRY_CODE_SI, CountryEurope::COUNTRY_NAME_SI[Language::EN_GB]],
139139
[++$number, 'getName', null, CountryEurope::COUNTRY_CODE_SK, CountryEurope::COUNTRY_NAME_SK[Language::EN_GB]],
140+
[++$number, 'getName', null, CountryEurope::COUNTRY_CODE_UA, CountryEurope::COUNTRY_NAME_UA[Language::EN_GB]],
140141
[++$number, 'getName', null, CountryEurope::COUNTRY_CODE_VA, CountryEurope::COUNTRY_NAME_VA[Language::EN_GB]],
141142

142143
/**

tests/Unit/TimezoneTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,8 @@ public function dataProvider(): array
131131
[++$number, 'getCountryName', null, 'Europe/Copenhagen', CountryEurope::COUNTRY_NAME_DK[Language::EN_GB]],
132132
[++$number, 'getCountryCode', null, 'Europe/Ljubljana', CountryEurope::COUNTRY_CODE_SI],
133133
[++$number, 'getCountryName', null, 'Europe/Ljubljana', CountryEurope::COUNTRY_NAME_SI[Language::EN_GB]],
134+
[++$number, 'getCountryCode', null, 'Europe/Kyiv', CountryEurope::COUNTRY_CODE_UA],
135+
[++$number, 'getCountryName', null, 'Europe/Kyiv', CountryEurope::COUNTRY_NAME_UA[Language::EN_GB]],
134136
[++$number, 'getCountryCode', null, 'Europe/London', CountryEurope::COUNTRY_CODE_GB],
135137
[++$number, 'getCountryName', null, 'Europe/London', CountryEurope::COUNTRY_NAME_GB[Language::EN_GB]],
136138
[++$number, 'getCountryCode', null, 'Europe/Luxembourg', CountryEurope::COUNTRY_CODE_LU],

0 commit comments

Comments
 (0)