diff options
author | Birte Kristina Friesel <derf@finalrewind.org> | 2024-10-03 11:36:05 +0200 |
---|---|---|
committer | Birte Kristina Friesel <derf@finalrewind.org> | 2024-10-03 11:36:05 +0200 |
commit | 6fa6997cb1bb859272ad3f426ab0e0bb94065c7e (patch) | |
tree | bd4be6b92610ac76fbac493ef1cfe6e74a34c748 /lib/Travel/Status/DE/EFA/Departure.pm | |
parent | 296da9b358d5c7258fc056db6ce3b3cf044fa99e (diff) |
efa-m: add --json option
Diffstat (limited to 'lib/Travel/Status/DE/EFA/Departure.pm')
-rw-r--r-- | lib/Travel/Status/DE/EFA/Departure.pm | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/Travel/Status/DE/EFA/Departure.pm b/lib/Travel/Status/DE/EFA/Departure.pm index 703b29c..3ad68a5 100644 --- a/lib/Travel/Status/DE/EFA/Departure.pm +++ b/lib/Travel/Status/DE/EFA/Departure.pm @@ -246,7 +246,18 @@ sub route_interesting { sub TO_JSON { my ($self) = @_; - return { %{$self} }; + my $ret = { %{$self} }; + + delete $ret->{strp_stopseq}; + delete $ret->{strp_stopseq_s}; + + for my $k (qw(datetime rt_datetime sched_datetime)) { + if ( $ret->{$k} ) { + $ret->{$k} = $ret->{$k}->epoch; + } + } + + return $ret; } 1; |