summaryrefslogtreecommitdiff
path: root/lib/DBInfoscreen/Controller
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2023-02-12 09:01:32 +0100
committerDaniel Friesel <derf@finalrewind.org>2023-02-12 09:01:32 +0100
commit80c9068e98d2c10f116dd52f9d51ff892936dae5 (patch)
treea6f67ad4e7b4fd6efd34e36413f909a482904f8a /lib/DBInfoscreen/Controller
parent721a443ad8714d37a8c1725759a75e8bd48301f5 (diff)
Fix HAFAS backend with rt=14.15.8
Diffstat (limited to 'lib/DBInfoscreen/Controller')
-rw-r--r--lib/DBInfoscreen/Controller/Stationboard.pm10
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');