journey details: include delay and distance in og card
This commit is contained in:
parent
10e913bd07
commit
1e1c71cfd8
1 changed files with 15 additions and 0 deletions
|
@ -669,9 +669,24 @@ sub public_journey_details {
|
||||||
my $title = sprintf( 'Fahrt von %s nach %s am %s',
|
my $title = sprintf( 'Fahrt von %s nach %s am %s',
|
||||||
$journey->{from_name}, $journey->{to_name},
|
$journey->{from_name}, $journey->{to_name},
|
||||||
$journey->{rt_arrival}->strftime('%d.%m.%Y') );
|
$journey->{rt_arrival}->strftime('%d.%m.%Y') );
|
||||||
|
my $delay = 'pünktlich ';
|
||||||
|
if ( $journey->{rt_arrival} != $journey->{sched_arrival} ) {
|
||||||
|
$delay = sprintf(
|
||||||
|
'mit %+d ',
|
||||||
|
(
|
||||||
|
$journey->{rt_arrival}->epoch
|
||||||
|
- $journey->{sched_arrival}->epoch
|
||||||
|
) / 60
|
||||||
|
);
|
||||||
|
}
|
||||||
my $description = sprintf( 'Ankunft mit %s %s %s',
|
my $description = sprintf( 'Ankunft mit %s %s %s',
|
||||||
$journey->{type}, $journey->{no},
|
$journey->{type}, $journey->{no},
|
||||||
$journey->{rt_arrival}->strftime('um %H:%M') );
|
$journey->{rt_arrival}->strftime('um %H:%M') );
|
||||||
|
if ( $journey->{km_route} > 0.1 ) {
|
||||||
|
$description = sprintf( '%.0f km mit %s %s – Ankunft %sum %s',
|
||||||
|
$journey->{km_route}, $journey->{type}, $journey->{no},
|
||||||
|
$delay, $journey->{rt_arrival}->strftime('%H:%M') );
|
||||||
|
}
|
||||||
my %tw_data = (
|
my %tw_data = (
|
||||||
card => 'summary',
|
card => 'summary',
|
||||||
site => '@derfnull',
|
site => '@derfnull',
|
||||||
|
|
Loading…
Reference in a new issue