@@ -167,6 +167,48 @@ class ExtendedDate extends FlxBasic {
167167 return this .getMonth () == 6 && this .getDate () == 4 ;
168168 }
169169
170+ public function isLaborDay (): Bool {
171+ return this .getMonth () == 8 && this .getDay () == 1 && this .getWeekOfMonth () == 1 ;
172+ }
173+
174+ public function isEaster (): Bool {
175+ // Easter is the first Sunday after the first full moon on or after the vernal equinox (March 21).
176+ // This is a simplified version and may not be accurate for all years.
177+ var year = this .getFullYear ();
178+ var month = this .getMonth ();
179+ var day = this .getDate ();
180+ var a = year % 19 ;
181+ var b = Math .floor (year / 100 );
182+ var c = year % 100 ;
183+ var d = Math .floor (b / 4 );
184+ var e = b % 4 ;
185+ var f = Math .floor ((b + 8 ) / 25 );
186+ var g = Math .floor ((b - f + 1 ) / 16 );
187+ var h = (19 * a + b - d - g + 15 ) % 30 ;
188+ var i = Math .floor (c / 16 );
189+ var k = c % 16 ;
190+ var l = (32 + 2 * e + 2 * i - h - k ) % 7 ;
191+ var m = Math .floor ((a + 11 * h + 22 * l ) / 451 );
192+ var monthEaster = Math .floor ((h + l - m + 90 ) / 25 );
193+ var dayEaster = (h + l - m + 28 ) % 31 + 1 ;
194+
195+ return month == monthEaster && day == dayEaster ;
196+ }
197+
198+ public function isNewYearsEve (): Bool {
199+ return this .getMonth () == 11 && this .getDate () == 31 ;
200+ }
201+
202+ public function isEasterSeason (): Bool {
203+ // Easter season is considered to be the 40 days leading up to Easter Sunday.
204+ var year = this .getFullYear ();
205+ var month = this .getMonth ();
206+ var day = this .getDate ();
207+ var easterDate = new ExtendedDate (year , 3 , 1 ); // March 1st
208+ var easterSunday = easterDate .isEaster ();
209+ return easterSunday && (month == 2 || (month == 3 && day <= 31 ));
210+ }
211+
170212 public function isHalloween (): Bool {
171213 return this .getMonth () == 9 && this .getDate () == 31 ;
172214 }
0 commit comments