From 341665c79bde28129d6ca78abf60a04aed6e49e7 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sat, 30 Mar 2019 21:43:35 +0100 Subject: [PATCH] sort journeys by departure time --- lib/Travelynx.pm | 7 +++++++ 1 file changed, 7 insertions(+) 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; } );