@@ -58,6 +58,7 @@ public function initialize(): void
58
58
$ this ->addHoliday ($ this ->secondChristmasDay ($ this ->year , $ this ->timezone , $ this ->locale ));
59
59
$ this ->calculateGreatPrayerDay ();
60
60
61
+ // Add other holidays
61
62
$ this ->addHoliday ($ this ->internationalWorkersDay ($ this ->year , $ this ->timezone , $ this ->locale , Holiday::TYPE_OBSERVANCE ));
62
63
$ this ->addHoliday ($ this ->christmasEve ($ this ->year , $ this ->timezone , $ this ->locale ));
63
64
$ this ->addHoliday ($ this ->newYearsEve ($ this ->year , $ this ->timezone , $ this ->locale , Holiday::TYPE_OBSERVANCE ));
@@ -67,6 +68,7 @@ public function initialize(): void
67
68
if ($ summerTime instanceof Holiday) {
68
69
$ this ->addHoliday ($ summerTime );
69
70
}
71
+
70
72
$ winterTime = $ this ->winterTime ($ this ->year , $ this ->timezone , $ this ->locale );
71
73
if ($ winterTime instanceof Holiday) {
72
74
$ this ->addHoliday ($ winterTime );
@@ -99,14 +101,20 @@ private function calculateGreatPrayerDay(): void
99
101
{
100
102
$ easter = $ this ->calculateEaster ($ this ->year , $ this ->timezone )->format ('Y-m-d ' );
101
103
102
- if ($ this ->year >= 1686 && $ this ->year < 2024 ) {
103
- $ this ->addHoliday (new Holiday (
104
- 'greatPrayerDay ' ,
105
- ['da ' => 'store bededag ' ],
106
- new \DateTime ("fourth friday {$ easter }" , DateTimeZoneFactory::getDateTimeZone ($ this ->timezone )),
107
- $ this ->locale
108
- ));
104
+ if ($ this ->year < 1686 ) {
105
+ return ;
109
106
}
107
+
108
+ if ($ this ->year >= 2024 ) {
109
+ return ;
110
+ }
111
+
112
+ $ this ->addHoliday (new Holiday (
113
+ 'greatPrayerDay ' ,
114
+ ['da ' => 'store bededag ' ],
115
+ new \DateTime ("fourth friday {$ easter }" , DateTimeZoneFactory::getDateTimeZone ($ this ->timezone )),
116
+ $ this ->locale
117
+ ));
110
118
}
111
119
112
120
/**
0 commit comments