Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def rosh_hashanah(year):
g = year % 19 + 1
r = 12 * g % 19
v = (floor(year / 100.0) - floor(year / 400.0) - 2)
v += 765433.0 * r / 492480
v += (year % 4) / 4.0
v -= (313.0 * year + 89081) / 98496
n = int(v)
f = v - n
# Monday .. Sunday = 0..6
dow = (datetime(year, 8, 31).weekday() + n) % 7
if dow in (2, 4, 6):
n += 1
elif dow == 0 and f >= 23269.0 / 25920 and r > 11:
n += 1
elif dow == 1 and f >= 1367.0 / 2160 and r > 6:
n += 2
return n
def _get_current_time():
return datetime.combine(datetime.today(), datetime.now().time())
def calc_passover_year(year):
return datetime(year, 3, 21) + timedelta(rosh_hashanah(year))
def _get_current_date():
return datetime.combine(datetime.today(), datetime.max.time())