summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBirte Kristina Friesel <derf@finalrewind.org>2025-01-22 20:39:58 +0100
committerBirte Kristina Friesel <derf@finalrewind.org>2025-01-22 20:39:58 +0100
commit19871c2f467d13c70f90a30ea1bde048f1aa7359 (patch)
tree3eb5fd0f8d9bd78c719ad967dd330a9dbee40c22
parent546858a40c882261f9701f1d1d8ba4634cb52bd8 (diff)
JourneyAtStop: TO_JSON: Serialize DateTime to epoch
-rw-r--r--lib/Travel/Status/DE/DBRIS/JourneyAtStop.pm6
1 files changed, 6 insertions, 0 deletions
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;
}