diff options
| author | Daniel Friesel <derf@finalrewind.org> | 2023-02-12 09:01:32 +0100 | 
|---|---|---|
| committer | Daniel Friesel <derf@finalrewind.org> | 2023-02-12 09:01:32 +0100 | 
| commit | 80c9068e98d2c10f116dd52f9d51ff892936dae5 (patch) | |
| tree | a6f67ad4e7b4fd6efd34e36413f909a482904f8a /lib | |
| parent | 721a443ad8714d37a8c1725759a75e8bd48301f5 (diff) | |
Fix HAFAS backend with rt=14.15.8
Diffstat (limited to 'lib')
| -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'); | 
