diff --git a/agenda/data.py b/agenda/data.py index d572c1d..75043bf 100644 --- a/agenda/data.py +++ b/agenda/data.py @@ -416,9 +416,16 @@ async def get_data( for launch in rockets: dt = None - if launch["net_precision"] == "Day": + net_precision = launch["net_precision"] + skip = {"Year", "Month", "Quarter", "Fiscal Year"} + if net_precision == "Day": dt = datetime.strptime(launch["net"], "%Y-%m-%dT%H:%M:%SZ").date() - elif launch["t0_time"]: + elif ( + net_precision + and net_precision not in skip + and "Year" not in net_precision + and launch["t0_time"] + ): dt = pytz.utc.localize( datetime.strptime(launch["net"], "%Y-%m-%dT%H:%M:%SZ") )