def hindu_lunar_holiday(l_month, l_day, gregorian_year): """Return the list of fixed dates of occurrences of Hindu lunar month, month, day, day, in Gregorian year, 'gregorian_year'.""" l_year = HinduLunarDate.from_fixed(GregorianDate.new_year(gregorian_year)).year date1 = hindu_date_occur(l_month, l_day, l_year) date2 = hindu_date_occur(l_month, l_day, l_year + 1) return list_range([date1, date2], GregorianDate.year_range(gregorian_year))
def hindu_lunar_event(l_month, tithi, tee, gregorian_year): """Return the list of fixed dates of occurrences of Hindu lunar tithi prior to sundial time, tee, in Hindu lunar month, l_month, in Gregorian year, 'gregorian_year'.""" l_year = HinduLunarDate.from_fixed(GregorianDate.new_year(gregorian_year)).year date1 = hindu_tithi_occur(l_month, tithi, tee, l_year) date2 = hindu_tithi_occur(l_month, tithi, tee, l_year + 1) return list_range([date1, date2], GregorianDate.year_range(gregorian_year))
def in_gregorian(cls, c_month, c_day, g_year): """Return the list of the fixed dates of Coptic month 'c_month', day 'c_day' that occur in Gregorian year 'g_year'.""" jan1 = GregorianDate.new_year(g_year) y = cls.from_fixed(jan1).year date1 = CopticDate(y, c_month, c_day).to_fixed() date2 = CopticDate(y + 1, c_month, c_day).to_fixed() return list_range([date1, date2], GregorianDate.year_range(g_year))
def yahrzeit_in_gregorian(self, gregorian_year): """Return the list of the fixed dates of death date death_date (yahrzeit) that occur in Gregorian year 'gregorian_year'.""" jan1 = GregorianDate.new_year(gregorian_year) y = HebrewDate.from_fixed(jan1).year date1 = self.yahrzeit(y) date2 = self.yahrzeit(y + 1) return list_range([date1, date2], GregorianDate.year_range(gregorian_year))
def birthday_in_gregorian(self, gregorian_year): """Return the list of the fixed dates of Hebrew birthday birthday that occur in Gregorian 'gregorian_year'.""" jan1 = GregorianDate.new_year(gregorian_year) y = HebrewDate.from_fixed(jan1).year date1 = self.birthday(y) date2 = self.birthday(y + 1) return list_range([date1, date2], GregorianDate.year_range(gregorian_year))
def julian_in_gregorian(j_month, j_day, g_year): """Return the list of the fixed dates of Julian month 'j_month', day 'j_day' that occur in Gregorian year 'g_year'.""" jan1 = GregorianDate.new_year(g_year) y = JulianDate.from_fixed(jan1).year y_prime = 1 if (y == -1) else (y + 1) date1 = JulianDate(y, j_month, j_day).to_fixed() date2 = JulianDate(y_prime, j_month, j_day).to_fixed() return list_range([date1, date2], GregorianDate.year_range(g_year))
def tzom_tevet(cls, gregorian_year): """Return the list of fixed dates for Tzom Tevet (Tevet 10) that occur in Gregorian year 'gregorian_year'. It can occur 0, 1 or 2 times per Gregorian year.""" jan1 = GregorianDate.new_year(gregorian_year) y = HebrewDate.from_fixed(jan1).year d1 = HebrewDate(y, HebrewMonth.TEVET, 10).to_fixed() d1 = d1 + 1 if DayOfWeek.from_fixed(d1) == DayOfWeek.Saturday else d1 d2 = HebrewDate(y + 1, HebrewMonth.TEVET, 10).to_fixed() d2 = d2 + 1 if DayOfWeek.from_fixed(d2) == DayOfWeek.Saturday else d2 dates = [d1, d2] return list_range(dates, GregorianDate.year_range(gregorian_year))
def in_gregorian(cls, month, day, gregorian_year): """Return list of the fixed dates of Hebrew month, 'month', day, 'day', that occur in Gregorian year 'gregorian_year'.""" jan1 = GregorianDate.new_year(gregorian_year) y = HebrewDate.from_fixed(jan1).year date1 = HebrewDate(y, month, day).to_fixed() date2 = HebrewDate(y + 1, month, day).to_fixed() # Hebrew and Gregorian calendar are aligned but certain # holidays, i.e. Tzom Tevet, can fall on either side of Jan 1. # So we can have 0, 1 or 2 occurences of that holiday. dates = [date1, date2] return list_range(dates, GregorianDate.year_range(gregorian_year))