From 19871c2f467d13c70f90a30ea1bde048f1aa7359 Mon Sep 17 00:00:00 2001 From: Birte Kristina Friesel Date: Wed, 22 Jan 2025 20:39:58 +0100 Subject: JourneyAtStop: TO_JSON: Serialize DateTime to epoch --- lib/Travel/Status/DE/DBRIS/JourneyAtStop.pm | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/Travel') diff --git a/lib/Travel/Status/DE/DBRIS/JourneyAtStop.pm b/lib/Travel/Status/DE/DBRIS/JourneyAtStop.pm index 98012ca..d813f04 100644 --- a/lib/Travel/Status/DE/DBRIS/JourneyAtStop.pm +++ b/lib/Travel/Status/DE/DBRIS/JourneyAtStop.pm @@ -66,6 +66,12 @@ sub TO_JSON { my $ret = { %{$self} }; + for my $k (qw(sched_dep rt_dep dep sched_arr rt_arr arr)) { + if ( $ret->{$k} ) { + $ret->{$k} = $ret->{$k}->epoch; + } + } + return $ret; } -- cgit v1.2.3