Space launches with known dates in the calendar

Closes: #71
This commit is contained in:
Edward Betts 2023-11-23 22:05:05 +00:00
parent 05453e8f1a
commit a8d36a55b0
2 changed files with 13 additions and 0 deletions

View file

@ -264,6 +264,17 @@ async def get_data(now: datetime) -> typing.Mapping[str, str | object]:
events += domains.renewal_dates(my_data)
for launch in rockets:
if not launch["t0_time"]:
continue
dt = pytz.utc.localize(datetime.strptime(launch["net"], "%Y-%m-%dT%H:%M:%SZ"))
e = Event(
name="rocket",
date=dt,
title=f'🚀{launch["rocket"]}: {launch["mission"]["name"]}',
)
events.append(e)
events.sort(key=operator.attrgetter("as_datetime"))
observer = sun.bristol()

View file

@ -94,6 +94,8 @@ def summarize_launch(launch: Launch) -> Summary:
return {
"name": launch["name"],
"status": launch["status"],
"net": launch["net"],
"net_precision": launch["net_precision"]["name"],
"t0_date": t0_date,
"t0_time": t0_time,
"window_start": launch["window_start"],