Commit 3c1742eb authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

Result: Fix TO_JSON helper

parent bd9de4e5
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -799,8 +799,19 @@ sub TO_JSON {
	my %copy = %{$self};
	delete $copy{arrival_wings};
	delete $copy{departure_wings};
	delete $copy{realtime_xml};
	delete $copy{replaced_by};
	delete $copy{replacement_for};
	delete $copy{strptime_obj};
	delete $copy{wing_of};

	for my $datetime_key (
		qw(arrival departure sched_arrival sched_departure start datetime))
	{
		if ( defined $copy{$datetime_key} ) {
			$copy{$datetime_key} = $copy{$datetime_key}->epoch;
		}
	}

	return {%copy};
}