Commit 05a7106 1 parent e7b3392 commit 05a7106 Copy full SHA for 05a7106
File tree 2 files changed +17
-2
lines changed
2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -33,7 +33,13 @@ class AustralianCapitalTerritory extends Australia
33
33
*/
34
34
public const ID = 'AU-ACT ' ;
35
35
36
- public string $ timezone = 'Australia/ACT ' ;
36
+ /**
37
+ * This was "Australia/ACT" in the past, which is only a link to Australia/Sydney.
38
+ * In recent versions of PHP "Australia/ACT" was removed, so this is no longer the link version.
39
+ *
40
+ * @see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
41
+ */
42
+ public string $ timezone = 'Australia/Sydney ' ;
37
43
38
44
/**
39
45
* Initialize holidays for Australian Capital Territory (Australia).
Original file line number Diff line number Diff line change @@ -48,7 +48,16 @@ class Ukraine extends AbstractProvider
48
48
*/
49
49
public function initialize (): void
50
50
{
51
- $ this ->timezone = 'Europe/Kiev ' ;
51
+ // the name of the timezone changed at some point and some systems support both names,
52
+ // while others only support the old or the new one -> try out, which version is actually working
53
+ try {
54
+ new \DateTimeZone ('Europe/Kiev ' );
55
+ $ this ->timezone = 'Europe/Kiev ' ;
56
+ } catch (\Exception $ e ) {
57
+ // this is an DateInvalidTimeZoneException only since 8.3
58
+ // see https://www.php.net/manual/en/datetimezone.construct.php
59
+ $ this ->timezone = 'Europe/Kyiv ' ;
60
+ }
52
61
53
62
// Add common holidays
54
63
// New Years Day will not be substituted to an monday if it's on a weekend!
You can’t perform that action at this time.
0 commit comments