summaryrefslogtreecommitdiff
path: root/lib/Travel/Status/DE
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2020-01-07 20:04:09 +0100
committerDaniel Friesel <derf@finalrewind.org>2020-01-07 20:04:09 +0100
commit3c1742eb0675bf257ea5cc76b481efe37cda9f84 (patch)
treefe8dddaa280667f646ea4d83edd03a6d7eaf55b5 /lib/Travel/Status/DE
parentbd9de4e5306075d859008cb2abea643caac58c8c (diff)
Result: Fix TO_JSON helper
Diffstat (limited to 'lib/Travel/Status/DE')
-rw-r--r--lib/Travel/Status/DE/IRIS/Result.pm11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/Travel/Status/DE/IRIS/Result.pm b/lib/Travel/Status/DE/IRIS/Result.pm
index c262e71..85fcacb 100644
--- a/lib/Travel/Status/DE/IRIS/Result.pm
+++ b/lib/Travel/Status/DE/IRIS/Result.pm
@@ -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};
}