get Number

This commit is contained in:
penner 2022-12-14 02:48:35 +00:00
parent 8269d8c976
commit b823aeaa69

View file

@ -32,18 +32,23 @@ async def get_date() -> str:
return date.today().isoformat()
@router.get("/number")
async def get_number() -> int:
today = date.today()
if today.month == 12:
return today.day
if today.month in (1, 2, 3):
return 24
return 0
async def user_can_view(
index: int,
) -> bool:
today = date.today()
if today.month in (1, 2, 3):
return True
elif today.month == 12:
return index < today.day
return False
return index < await get_number()
@router.get(