diff options
Diffstat (limited to 'lib/DBInfoscreen/Controller')
-rw-r--r-- | lib/DBInfoscreen/Controller/Stationboard.pm | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/DBInfoscreen/Controller/Stationboard.pm b/lib/DBInfoscreen/Controller/Stationboard.pm index 8eac6b0..a81c7d5 100644 --- a/lib/DBInfoscreen/Controller/Stationboard.pm +++ b/lib/DBInfoscreen/Controller/Stationboard.pm @@ -1328,7 +1328,10 @@ sub handle_result { } if ($show_realtime) { - if ( $admode eq 'arr' ) { + if ( $self->param('hafas') ) { + @results = sort { $a->datetime <=> $b->datetime } @results; + } + elsif ( $admode eq 'arr' ) { @results = sort { ( $a->arrival // $a->departure ) <=> ( $b->arrival // $b->departure ) @@ -1404,7 +1407,10 @@ sub handle_result { } if ($show_realtime) { - if ( ( $admode eq 'arr' and $result->arrival ) + if ( $self->param('hafas') ) { + $time = $result->datetime->strftime('%H:%M'); + } + elsif ( ( $admode eq 'arr' and $result->arrival ) or not $result->departure ) { $time = $result->arrival->strftime('%H:%M'); |