diff options
author | Birte Kristina Friesel <derf@finalrewind.org> | 2024-12-28 18:14:23 +0100 |
---|---|---|
committer | Birte Kristina Friesel <derf@finalrewind.org> | 2024-12-28 18:14:23 +0100 |
commit | 41714c42ee0fcd48e47b5ad1dc77b0727980061b (patch) | |
tree | 3d920928b3890e5f815d1128b931e545fef3bf4a /bin/dbris-m | |
parent | 31ef58b4217a60429f77b58a5b2c9c549f40d19e (diff) |
trip details: process delays
Diffstat (limited to 'bin/dbris-m')
-rwxr-xr-x | bin/dbris-m | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/bin/dbris-m b/bin/dbris-m index 8733915..8241cb8 100755 --- a/bin/dbris-m +++ b/bin/dbris-m @@ -254,6 +254,8 @@ elsif ( $opt{journey} ) { my $max_name = max map { length( $_->name ) } $trip->route; my $max_platform = max map { length( $_->platform // q{} ) } $trip->route; + my $max_delay + = max map { $_->delay ? length( $_->delay ) + 3 : 0 } $trip->route; my $mark_stop = 0; my $now = DateTime->now( time_zone => 'Europe/Berlin' ); @@ -293,6 +295,8 @@ elsif ( $opt{journey} ) { else { print(' '); } + printf( " %${max_delay}s", + format_delay( $stop->delay, $max_delay - 3 ) ); printf( " %-${max_name}s %${max_platform}s\n", $stop->name, $stop->platform // q{} ); if ( $stop == $mark_stop ) { |