diff options
author | Daniel Friesel <derf@finalrewind.org> | 2019-03-30 21:43:35 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2019-03-30 21:43:35 +0100 |
commit | 341665c79bde28129d6ca78abf60a04aed6e49e7 (patch) | |
tree | 9b05e37fab5d7bbd7d2997d8ae25b57a42c24858 /lib | |
parent | df34c58cc5190946f51a0c2d2d1d2fe159569599 (diff) |
sort journeys by departure time
Diffstat (limited to 'lib')
-rwxr-xr-x | lib/Travelynx.pm | 7 |
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; } ); |