Unverified Commit 19d3f4af authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

InTransit->add: Use a global $now object

parent 850d591f
Loading
Loading
Loading
Loading
+31 −30
Original line number Diff line number Diff line
@@ -104,6 +104,7 @@ sub add {
	my $persistent_data;

	my $json = JSON->new;
	my $now  = DateTime->now( time_zone => 'Europe/Berlin' );

	if ($train) {

@@ -115,7 +116,7 @@ sub add {
				cancelled => $train->departure_is_cancelled ? 1
				: 0,
				checkin_station_id => $checkin_station_id,
				checkin_time => DateTime->now( time_zone => 'Europe/Berlin' ),
				checkin_time       => $now,
				dep_platform       => $train->platform,
				train_type         => $train->type,
				train_line         => $train->line_no,
@@ -175,7 +176,7 @@ sub add {
				? 1
				: 0,
				checkin_station_id => $stop->loc->eva,
				checkin_time => DateTime->now( time_zone => 'Europe/Berlin' ),
				checkin_time       => $now,
				dep_platform       => $stop->{platform},
				train_type         => $product->type // q{},
				train_line         => $product->line_no,
@@ -260,7 +261,7 @@ sub add {
				? 1
				: 0,
				checkin_station_id => $stop->eva,
				checkin_time => DateTime->now( time_zone => 'Europe/Berlin' ),
				checkin_time       => $now,
				dep_platform       => $stop->platform,
				train_type         => $journey->type // q{},
				train_line         => $line,