diff options
Diffstat (limited to 'lib/Travel/Status/DE/DBRIS/Journey.pm')
-rw-r--r-- | lib/Travel/Status/DE/DBRIS/Journey.pm | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/Travel/Status/DE/DBRIS/Journey.pm b/lib/Travel/Status/DE/DBRIS/Journey.pm index df7eada..30026ca 100644 --- a/lib/Travel/Status/DE/DBRIS/Journey.pm +++ b/lib/Travel/Status/DE/DBRIS/Journey.pm @@ -9,7 +9,7 @@ use parent 'Class::Accessor'; our $VERSION = '0.01'; Travel::Status::DE::DBRIS::Journey->mk_ro_accessors( - qw(type dep sched_dep rt_dep is_cancelled line stop_name stop_eva id admin_id journey_id sched_platform platform dest_name dest_eva route) + qw(type dep sched_dep rt_dep delay is_cancelled line stop_name stop_eva id admin_id journey_id sched_platform platform dest_name dest_eva route) ); sub new { @@ -40,6 +40,11 @@ sub new { } $ref->{dep} = $ref->{rt_dep} // $ref->{schd_dep}; + if ( $ref->{sched_dep} and $ref->{rt_dep} ) { + $ref->{delay} = $ref->{rt_dep}->subtract_datetime( $ref->{sched_dep} ) + ->in_units('minutes'); + } + return $ref; } |