diff options
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/hafas | 18 |
1 files changed, 16 insertions, 2 deletions
@@ -254,8 +254,22 @@ for my $res ( @{ $hafas->{results} } ) { # say "# cancelled\n"; #} - my $glance = join( ' - ', - map { $_->name } grep { $_->type eq 'JNY' } $res->sections ); + my $glance = q{}; + for my $sec ( $res->sections ) { + if ( $sec->type ne 'JNY' ) { + next; + } + if ( defined $sec->transfer_duration ) { + $glance .= sprintf( + ' (%01d:%02d) %s', + $sec->transfer_duration->in_units( 'hours', 'minutes' ), + $sec->name + ); + } + else { + $glance .= $sec->name; + } + } printf( "# %02d:%02d %s %s\n", |