diff --git a/apps/state/lib/state/service.ex b/apps/state/lib/state/service.ex index c5ff93a2..45440701 100644 --- a/apps/state/lib/state/service.ex +++ b/apps/state/lib/state/service.ex @@ -34,11 +34,11 @@ defmodule State.Service do end @doc """ - Returns all Services that are valid today or any date in the future. + Returns all Services that are valid at the feed start or any day in the future. """ - def valid_in_future do - now = Parse.Time.service_date() - Enum.filter(all(), &Service.valid_after?(&1, now)) + def valid_in_feed do + {_, feed_start, _} = State.Feed.feed_metadata() + Enum.filter(all(), &Service.valid_after?(&1, feed_start)) end @doc """ diff --git a/apps/state/lib/state/service_by_date.ex b/apps/state/lib/state/service_by_date.ex index dded79c4..1974e5a2 100644 --- a/apps/state/lib/state/service_by_date.ex +++ b/apps/state/lib/state/service_by_date.ex @@ -63,7 +63,7 @@ defmodule State.ServiceByDate do def update_state(state) do items = - State.Service.valid_in_future() + State.Service.valid_in_feed() |> service_with_date @table |> :ets.delete_all_objects()