Loading bin/hafas-m +8 −4 Original line number Diff line number Diff line Loading @@ -95,7 +95,9 @@ elsif ( $opt{station} =~ m{ ^ [!] (?<query> .*) $ }x ) { } if ( $date or $time ) { my $dt = DateTime->now( time_zone => 'Europe/Berlin' ); my $desc = Travel::Status::DE::HAFAS::get_service($service) // {}; my $dt = DateTime->now( time_zone => $desc->{time_zone} // 'Europe/Berlin' ); if ($date) { if ( $date =~ m{ ^ (?<day> \d{1,2} ) [.] (?<month> \d{1,2} ) [.] (?<year> \d{4})? $ }x Loading Loading @@ -355,7 +357,7 @@ if ( $opt{journeyMatch} ) { say $result->id; print $result->name; if ( $result->number ) { printf( " | Zug %s", $result->number ); printf( " | Nr %s", $result->number ); } if ( $result->line_no ) { printf( " | Linie %s", $result->line_no ); Loading Loading @@ -396,7 +398,7 @@ elsif ( $opt{journey} ) { printf( "%s → %s", $result->name, $result->route_end ); if ( $result->number ) { printf( " / Zug %s", $result->number ); printf( " / Nr %s", $result->number ); } if ( $result->line_no ) { printf( " / Linie %s", $result->line_no ); Loading Loading @@ -446,7 +448,9 @@ elsif ( $opt{journey} ) { } $prev_prod = 0; my $now = DateTime->now( time_zone => 'Europe/Berlin' ); my $desc = Travel::Status::DE::HAFAS::get_service($service) // {}; my $now = DateTime->now( time_zone => $desc->{time_zone} // 'Europe/Berlin' ); my $mark_stop = 0; for my $i ( reverse 1 .. scalar $result->route ) { my $stop = ( $result->route )[ $i - 1 ]; Loading lib/Travel/Status/DE/HAFAS.pm +6 −2 Original line number Diff line number Diff line Loading @@ -63,6 +63,7 @@ my %hafas_instance = ( stopfinder => 'https://planner.bart.gov/bin/ajax-getstop.exe', mgate => 'https://planner.bart.gov/bin/mgate.exe', name => 'Bay Area Rapid Transit', time_zone => 'America/Los_Angeles', productbits => [ [ _ => undef ], [ _ => undef ], Loading Loading @@ -118,6 +119,7 @@ my %hafas_instance = ( 'https://journeyplanner.irishrail.ie/bin/ajax-getstop.exe', mgate => 'https://journeyplanner.irishrail.ie/bin/mgate.exe', name => 'Iarnród Éireann', time_zone => 'Europe/Dublin', productbits => [ [ _ => undef ], [ ic => 'national trains' ], Loading Loading @@ -215,6 +217,7 @@ my %hafas_instance = ( mgate => 'https://fahrplan.oebb.at/bin/mgate.exe', stopfinder => 'https://fahrplan.oebb.at/bin/ajax-getstop.exe', name => 'Österreichische Bundesbahnen', time_zone => 'Europe/Vienna', productbits => [ [ ice_rj => 'long distance trains' ], [ sev => 'rail replacement service' ], Loading Loading @@ -328,7 +331,8 @@ sub new { confess("The service '$service' is not supported"); } my $now = DateTime->now( time_zone => 'Europe/Berlin' ); my $now = DateTime->now( time_zone => $hafas_instance{$service}{time_zone} // 'Europe/Berlin' ); my $self = { active_service => $service, arrivals => $conf{arrivals}, Loading Loading @@ -482,7 +486,7 @@ sub new { $self->{strptime_obj} //= DateTime::Format::Strptime->new( pattern => '%Y%m%dT%H%M%S', time_zone => 'Europe/Berlin', time_zone => $hafas_instance{$service}{time_zone} // 'Europe/Berlin', ); my $json = $self->{json} = JSON->new->utf8; Loading lib/Travel/Status/DE/HAFAS/Journey.pm +2 −1 Original line number Diff line number Diff line Loading @@ -94,7 +94,8 @@ sub new { } $datetime_ref = DateTime::Format::Strptime->new( pattern => $parse_fmt, time_zone => 'Europe/Berlin' time_zone => $hafas->get_active_service->{time_zone} // 'Europe/Berlin' )->parse_datetime($date_ref); } Loading Loading
bin/hafas-m +8 −4 Original line number Diff line number Diff line Loading @@ -95,7 +95,9 @@ elsif ( $opt{station} =~ m{ ^ [!] (?<query> .*) $ }x ) { } if ( $date or $time ) { my $dt = DateTime->now( time_zone => 'Europe/Berlin' ); my $desc = Travel::Status::DE::HAFAS::get_service($service) // {}; my $dt = DateTime->now( time_zone => $desc->{time_zone} // 'Europe/Berlin' ); if ($date) { if ( $date =~ m{ ^ (?<day> \d{1,2} ) [.] (?<month> \d{1,2} ) [.] (?<year> \d{4})? $ }x Loading Loading @@ -355,7 +357,7 @@ if ( $opt{journeyMatch} ) { say $result->id; print $result->name; if ( $result->number ) { printf( " | Zug %s", $result->number ); printf( " | Nr %s", $result->number ); } if ( $result->line_no ) { printf( " | Linie %s", $result->line_no ); Loading Loading @@ -396,7 +398,7 @@ elsif ( $opt{journey} ) { printf( "%s → %s", $result->name, $result->route_end ); if ( $result->number ) { printf( " / Zug %s", $result->number ); printf( " / Nr %s", $result->number ); } if ( $result->line_no ) { printf( " / Linie %s", $result->line_no ); Loading Loading @@ -446,7 +448,9 @@ elsif ( $opt{journey} ) { } $prev_prod = 0; my $now = DateTime->now( time_zone => 'Europe/Berlin' ); my $desc = Travel::Status::DE::HAFAS::get_service($service) // {}; my $now = DateTime->now( time_zone => $desc->{time_zone} // 'Europe/Berlin' ); my $mark_stop = 0; for my $i ( reverse 1 .. scalar $result->route ) { my $stop = ( $result->route )[ $i - 1 ]; Loading
lib/Travel/Status/DE/HAFAS.pm +6 −2 Original line number Diff line number Diff line Loading @@ -63,6 +63,7 @@ my %hafas_instance = ( stopfinder => 'https://planner.bart.gov/bin/ajax-getstop.exe', mgate => 'https://planner.bart.gov/bin/mgate.exe', name => 'Bay Area Rapid Transit', time_zone => 'America/Los_Angeles', productbits => [ [ _ => undef ], [ _ => undef ], Loading Loading @@ -118,6 +119,7 @@ my %hafas_instance = ( 'https://journeyplanner.irishrail.ie/bin/ajax-getstop.exe', mgate => 'https://journeyplanner.irishrail.ie/bin/mgate.exe', name => 'Iarnród Éireann', time_zone => 'Europe/Dublin', productbits => [ [ _ => undef ], [ ic => 'national trains' ], Loading Loading @@ -215,6 +217,7 @@ my %hafas_instance = ( mgate => 'https://fahrplan.oebb.at/bin/mgate.exe', stopfinder => 'https://fahrplan.oebb.at/bin/ajax-getstop.exe', name => 'Österreichische Bundesbahnen', time_zone => 'Europe/Vienna', productbits => [ [ ice_rj => 'long distance trains' ], [ sev => 'rail replacement service' ], Loading Loading @@ -328,7 +331,8 @@ sub new { confess("The service '$service' is not supported"); } my $now = DateTime->now( time_zone => 'Europe/Berlin' ); my $now = DateTime->now( time_zone => $hafas_instance{$service}{time_zone} // 'Europe/Berlin' ); my $self = { active_service => $service, arrivals => $conf{arrivals}, Loading Loading @@ -482,7 +486,7 @@ sub new { $self->{strptime_obj} //= DateTime::Format::Strptime->new( pattern => '%Y%m%dT%H%M%S', time_zone => 'Europe/Berlin', time_zone => $hafas_instance{$service}{time_zone} // 'Europe/Berlin', ); my $json = $self->{json} = JSON->new->utf8; Loading
lib/Travel/Status/DE/HAFAS/Journey.pm +2 −1 Original line number Diff line number Diff line Loading @@ -94,7 +94,8 @@ sub new { } $datetime_ref = DateTime::Format::Strptime->new( pattern => $parse_fmt, time_zone => 'Europe/Berlin' time_zone => $hafas->get_active_service->{time_zone} // 'Europe/Berlin' )->parse_datetime($date_ref); } Loading