Skip to content

Commit

Permalink
Merge pull request #65 from mbta/ph-fix-prediction-time-logic
Browse files Browse the repository at this point in the history
fix: select arrival/departure times correctly
  • Loading branch information
handorff authored Mar 20, 2020
2 parents bd8d79e + 114aaae commit f6abbd5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/screens/predictions/parser.ex
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,10 @@ defmodule Screens.Predictions.Parser do
departure_time = parse_time(departure_time_string)

time =
case arrival_time do
nil -> departure_time
t -> t
case {arrival_time, departure_time} do
{nil, t} -> t
{_, nil} -> nil
{t, _} -> t
end

%{
Expand Down

0 comments on commit f6abbd5

Please sign in to comment.