From 66a05f8b8ae094f5ac36554abddaa2dadf5f7b83 Mon Sep 17 00:00:00 2001 From: Claudio Schaad Date: Fri, 5 Sep 2025 18:07:58 +0200 Subject: [PATCH] Fix build errors --- Services/GoogleCalendarService.cs | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/Services/GoogleCalendarService.cs b/Services/GoogleCalendarService.cs index 0e1c601..6f38c38 100644 --- a/Services/GoogleCalendarService.cs +++ b/Services/GoogleCalendarService.cs @@ -109,7 +109,7 @@ public class GoogleCalendarService : IGoogleCalendarService var summary = $"{shift.Name} ({period})"; var description = ""; - if (transport != null && !string.IsNullOrEmpty(transport.DepartureTime)) + if (transport != null) { var transportInfo = FormatTransportInfo(transport); description = $"Transport: {transportInfo}"; @@ -143,15 +143,8 @@ public class GoogleCalendarService : IGoogleCalendarService private static string FormatTransportInfo(TransportConnection transport) { - var departure = DateTime.TryParse(transport.DepartureTime, out var dep) ? dep.ToString("HH:mm") : transport.DepartureTime; - var arrival = DateTime.TryParse(transport.ArrivalTime, out var arr) ? arr.ToString("HH:mm") : transport.ArrivalTime; - - var mainJourney = transport.Sections?.FirstOrDefault()?.Journey; - if (mainJourney != null) - { - return $"{mainJourney.Category} {mainJourney.Number}: {departure} → {arrival}"; - } - + var departure = transport.DepartureTime.ToString("HH:mm"); + var arrival = transport.ArrivalTime.ToString("HH:mm"); return $"{departure} → {arrival}"; }