From 4e63dccbf00a110367b8d720783098c5f04937b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn-Michael=20Miehe?= <40151420+ldericher@users.noreply.github.com> Date: Fri, 27 Oct 2023 00:22:01 +0200 Subject: [PATCH] api hotfix: use `now()` instead of `utcnow` --- api/ovdashboard_api/core/caldav.py | 2 +- api/ovdashboard_api/core/calevent.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/api/ovdashboard_api/core/caldav.py b/api/ovdashboard_api/core/caldav.py index 4f7b97a..128b9eb 100644 --- a/api/ovdashboard_api/core/caldav.py +++ b/api/ovdashboard_api/core/caldav.py @@ -79,7 +79,7 @@ class CalDAV: _logger.info(f"downloading {calendar_name!r} ...") dt_start = datetime.combine( - datetime.utcnow().date(), + datetime.now().date(), datetime.min.time(), ) dt_end = dt_start + timedelta(days=cfg.calendar.future_days) diff --git a/api/ovdashboard_api/core/calevent.py b/api/ovdashboard_api/core/calevent.py index 0823072..c22bbca 100644 --- a/api/ovdashboard_api/core/calevent.py +++ b/api/ovdashboard_api/core/calevent.py @@ -31,8 +31,8 @@ class CalEvent(BaseModel): summary: StrippedStr = "" description: StrippedStr = "" - dtstart: datetime = datetime.utcnow() - dtend: datetime = datetime.utcnow() + dtstart: datetime = datetime.now() + dtend: datetime = datetime.now() def __lt__(self, other: Self) -> bool: """