Example #1
0
    def format_omer(self, jewish_calendar: JewishCalendar) -> str:
        """
        Returns a string of the Omer day

        The string is formatted in the form ל"ג בעומר if Hebrew format is set,
        or "Omer X" or "Lag BaOmer" if not.

        If no Omer is counted, the string is empty.

        By default the value is prefixed by "ב", this can be changed to "ל" by
        changing the hebrew_omer_prefix class variable.
        """
        omer = jewish_calendar.day_of_omer()
        if omer is None:
            return ""

        if self.hebrew_format:
            return (f"{self.format_hebrew_number(omer)} "
                    f"{self.hebrew_omer_prefix}עומר")
        else:
            if omer == 33:  # if lag b'omer
                return "Lag BaOmer"
            else:
                return f"Omer {omer}"
 def test_day_of_omer_outside_of_omer(self):
     calendar = JewishCalendar(test.test_helper.standard_monday_chaseirim(),
                               7, 1)
     self.assertIsNone(calendar.day_of_omer())
 def find_day(c: JewishCalendar):
     found_days.append(c.day_of_omer())
     c.forward()