diff --git a/test/test_jewish_calendar.py b/test/test_jewish_calendar.py index 35edd6b..0e5a87f 100644 --- a/test/test_jewish_calendar.py +++ b/test/test_jewish_calendar.py @@ -598,6 +598,16 @@ def test_is_taanis_bechorim_for_nonstandard_year(self): expected = ['1-12'] self.assertEqual(all_days, expected) + def test_is_shabbos_mevorchim(self): + year = test.test_helper.leap_shabbos_shelaimim() + + all_days = test.test_helper.all_days_matching(year, lambda c: c.is_shabbos_mevorchim()).values() + all_days = [item for sublist in all_days for item in sublist] # flatten + expected = ['7-29', '8-27', '9-25', '10-23', + '11-29', '12-27', '13-25', '1-24', + '2-29', '3-28', '4-26', '5-25'] + self.assertEqual(all_days, expected) + def test_is_rosh_chodesh(self): year = test.test_helper.leap_shabbos_shelaimim() diff --git a/zmanim/hebrew_calendar/jewish_calendar.py b/zmanim/hebrew_calendar/jewish_calendar.py index c5caab4..6800ed0 100644 --- a/zmanim/hebrew_calendar/jewish_calendar.py +++ b/zmanim/hebrew_calendar/jewish_calendar.py @@ -93,6 +93,9 @@ def is_taanis_bechorim(self) -> bool: return ((self.day_of_week != 7 and self.jewish_day == 14 and self.jewish_month == 1) or (self.day_of_week == 5 and self.jewish_day == 12 and self.jewish_month == 1)) + def is_shabbos_mevorchim(self) -> bool: + return self.day_of_week == 7 and self.jewish_month != 6 and self.jewish_day in range(23, 30) + def is_rosh_chodesh(self) -> bool: return self.jewish_day == 30 or (self.jewish_day == 1 and self.jewish_month != 7)