Show future birthdays
This commit is contained in:
parent
26e194c20b
commit
0a33c069b0
|
@ -3,6 +3,7 @@
|
|||
from datetime import date
|
||||
|
||||
import yaml
|
||||
from rich.pretty import pprint
|
||||
|
||||
from .types import Event
|
||||
|
||||
|
@ -28,11 +29,12 @@ 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)
|
||||
for offset in range(2):
|
||||
events.append(
|
||||
Event(
|
||||
date=bday,
|
||||
date=bday.replace(year=bday.year + offset),
|
||||
name="birthday",
|
||||
title=f'{entity["label"]} (aged {age})',
|
||||
title=f'{entity["label"]} (aged {age + offset})',
|
||||
)
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in a new issue