🔧 Fix: Correct date handling in Trip class

🗓️ Utilize utils.as_date for date conversions in travel checks.

Closes: #181
This commit is contained in:
Edward Betts 2024-10-17 12:56:21 +01:00
parent a1cdf62eef
commit 9ad2ba9462

View file

@ -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)