Show future birthdays

This commit is contained in:
Edward Betts 2023-11-23 14:27:32 +00:00
parent 26e194c20b
commit 0a33c069b0

View file

@ -3,6 +3,7 @@
from datetime import date
import yaml
from rich.pretty import pprint
from .types import Event
@ -28,12 +29,13 @@ def get_birthdays(from_date: date, filepath: str) -> list[Event]:
for entity in entities:
birthday = date(**entity["birthday"])
bday, age = next_birthday(from_date, birthday)
events.append(
Event(
date=bday,
name="birthday",
title=f'{entity["label"]} (aged {age})',
for offset in range(2):
events.append(
Event(
date=bday.replace(year=bday.year + offset),
name="birthday",
title=f'{entity["label"]} (aged {age + offset})',
)
)
)
return events