File tree 2 files changed +21
-1
lines changed
2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,8 @@ public function getHolidaysByYear($year)
37
37
{
38
38
$ easter = $ this ->getEasterDates ($ year );
39
39
40
+ $ repentanceDay = $ this ->getDayOfRepentance ($ year );
41
+
40
42
// 500th anniversay of the Reformation
41
43
// @see https://de.wikipedia.org/wiki/Reformationstag#Deutschland
42
44
if (2017 === $ year ) {
@@ -89,10 +91,26 @@ public function getHolidaysByYear($year)
89
91
self ::STATE_NW ,
90
92
self ::STATE_RP ,
91
93
self ::STATE_SL ,
94
+ )),
95
+ $ repentanceDay ->format (self ::DATE_FORMAT ) => $ this ->createData ('Buß- und Bettag ' , array (
96
+ self ::STATE_SN
92
97
))
93
98
);
94
99
95
100
return $ holidays ;
96
101
}
97
102
103
+ /**
104
+ * The German day of repentance is the wednesday befor the 23rd of November
105
+ * @param int $year
106
+ * @return \DateTime
107
+ */
108
+ public function getDayOfRepentance ($ year )
109
+ {
110
+ $ date = new \DateTime ($ year .'-11-23 ' );
111
+ $ date ->modify ('previous wednesday ' );
112
+
113
+ return $ date ;
114
+ }
115
+
98
116
}
Original file line number Diff line number Diff line change @@ -36,7 +36,9 @@ public function dateProvider()
36
36
array ('2017-10-31 ' , DE ::STATE_SH , array ('name ' => 'Reformationstag ' )),
37
37
array ('2017-10-31 ' , DE ::STATE_BB , array ('name ' => 'Reformationstag ' )),
38
38
array ('2018-10-31 ' , DE ::STATE_SH , null ),
39
- array ('2018-10-31 ' , DE ::STATE_BB , array ('name ' => 'Reformationstag ' )),
39
+ array ('2018-11-21 ' , DE ::STATE_BB , null ),
40
+ array ('2018-11-21 ' , DE ::STATE_SN , array ('name ' => 'Buß- und Bettag ' )),
41
+ array ('2018-10-31 ' , DE ::STATE_SH , null ),
40
42
);
41
43
}
42
44
}
You can’t perform that action at this time.
0 commit comments