diff options
author | stuebinm | 2022-11-29 15:29:28 +0100 |
---|---|---|
committer | stuebinm | 2022-11-29 15:29:28 +0100 |
commit | 574115063dcbad49bdb9392fbf370618243b12c4 (patch) | |
tree | 496d2068979bc957bde925b9a397655c250561a5 | |
parent | f66e6dc0f73032cc4537963822ac9283a24ca487 (diff) |
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??
-rw-r--r-- | lib/GTFS.hs | 5 |
1 files changed, 4 insertions, 1 deletions
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) |