From 9ad2ba94623e50ab8ccd34448ebd1d305860a001 Mon Sep 17 00:00:00 2001 From: Edward Betts Date: Thu, 17 Oct 2024 12:56:21 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20Fix:=20Correct=20date=20handling?= =?UTF-8?q?=20in=20Trip=20class?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🗓️ Utilize utils.as_date for date conversions in travel checks. Closes: #181 --- agenda/types.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/agenda/types.py b/agenda/types.py index 3fc6b08..bbb8e00 100644 --- a/agenda/types.py +++ b/agenda/types.py @@ -75,11 +75,11 @@ class Trip: ] if not titles: for travel in self.travel: - if travel["depart"] and travel["depart"].date() != self.start: + if travel["depart"] and utils.as_date(travel["depart"]) != self.start: place = travel["from"] if place not in titles: titles.append(place) - if travel["depart"] and travel["depart"].date() != self.end: + if travel["depart"] and utils.as_date(travel["depart"]) != self.end: place = travel["to"] if place not in titles: titles.append(place)