From 998e5c2a0d9e1a174bed5b60c9fc7b0da238b60e Mon Sep 17 00:00:00 2001 From: Tim Birkett Date: Wed, 9 Aug 2023 16:20:24 +0100 Subject: [PATCH] fix: datetime.datetime is an instance of datetime.date --- ical-proxy/app.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ical-proxy/app.py b/ical-proxy/app.py index cd31989..ba9d440 100644 --- a/ical-proxy/app.py +++ b/ical-proxy/app.py @@ -74,9 +74,10 @@ def _ical_annotations(url: str, tags: str): return ical_as_annotations -def _millis_timestamp(dt: datetime.datetime): - if isinstance(dt, datetime.date): +def _millis_timestamp(dt): + if (not isinstance(dt, datetime.datetime)) and isinstance(dt, datetime.date): dt = datetime.datetime(dt.year, dt.month, dt.day, tzinfo=datetime.timezone.utc) + return int(dt.timestamp() * 1000)