aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/GTFS.hs5
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)