summaryrefslogtreecommitdiff
path: root/lib/Travelynx.pm
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2019-03-30 21:43:35 +0100
committerDaniel Friesel <derf@finalrewind.org>2019-03-30 21:43:35 +0100
commit341665c79bde28129d6ca78abf60a04aed6e49e7 (patch)
tree9b05e37fab5d7bbd7d2997d8ae25b57a42c24858 /lib/Travelynx.pm
parentdf34c58cc5190946f51a0c2d2d1d2fe159569599 (diff)
sort journeys by departure time
Diffstat (limited to 'lib/Travelynx.pm')
-rwxr-xr-xlib/Travelynx.pm7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Travelynx.pm b/lib/Travelynx.pm
index 778e194..f453f56 100755
--- a/lib/Travelynx.pm
+++ b/lib/Travelynx.pm
@@ -1067,6 +1067,13 @@ qq{select * from pending_mails where email = ? and num_tries > 1;}
} @travels;
}
+ # user_actions are sorted by action_time. As users are allowed to check
+ # into trains in arbitrary order, action_time does not always
+ # correspond to departure/arrival time, so we ensure a proper sort
+ # order here.
+ @travels
+ = sort { $b->{rt_departure} <=> $a->{rt_departure} } @travels;
+
return @travels;
}
);