From 574115063dcbad49bdb9392fbf370618243b12c4 Mon Sep 17 00:00:00 2001 From: stuebinm Date: Tue, 29 Nov 2022 15:29:28 +0100 Subject: respect gtfs start/end date not only is this a surprisingly stupid bug, i distinctly remember writing these few lines sometime ago … but they're not in the commit history, so i guess they got lost somehow?? --- lib/GTFS.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/GTFS.hs b/lib/GTFS.hs index 4e2a7dc..1fda897 100644 --- a/lib/GTFS.hs +++ b/lib/GTFS.hs @@ -611,7 +611,10 @@ servicesOnDay GTFS{..} day = where (added,removed) = V.partition (\cd -> caldateExceptionType cd == ServiceAdded) . fromMaybe mempty $ M.lookup day calendarDates - regular = maybe mempty (fmap calServiceId) $ M.lookup (dayOfWeek day) calendar + regular = fmap calServiceId + $ V.filter (\Calendar{..} -> day >= calStartDate && day <= calEndDate) + $ maybe mempty id + $ M.lookup (dayOfWeek day) calendar notCancelled serviceID = null (tableLookup caldateServiceId serviceID removed) -- cgit v1.2.3