summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Travel/Status/DE/IRIS.pm2
-rw-r--r--lib/Travel/Status/DE/IRIS/Result.pm6
2 files changed, 5 insertions, 3 deletions
diff --git a/lib/Travel/Status/DE/IRIS.pm b/lib/Travel/Status/DE/IRIS.pm
index c805d21..9d7f5ee 100644
--- a/lib/Travel/Status/DE/IRIS.pm
+++ b/lib/Travel/Status/DE/IRIS.pm
@@ -128,7 +128,7 @@ sub new {
} @{ $self->{results} };
@{ $self->{results} }
- = sort { $a->{datetime} <=> $b->{datetime} } @{ $self->{results} };
+ = sort { $a->{epoch} <=> $b->{epoch} } @{ $self->{results} };
# wings (different departures which are coupled as one train) contain
# references to each other. therefore, they must be processed last.
diff --git a/lib/Travel/Status/DE/IRIS/Result.pm b/lib/Travel/Status/DE/IRIS/Result.pm
index 7cc8c7c..96517d9 100644
--- a/lib/Travel/Status/DE/IRIS/Result.pm
+++ b/lib/Travel/Status/DE/IRIS/Result.pm
@@ -153,8 +153,9 @@ sub new {
my $dt = $ref->{datetime} = $dp // $ar;
- $ref->{date} = $dt->strftime('%d.%m.%Y');
- $ref->{time} = $dt->strftime('%H:%M');
+ $ref->{date} = $dt->strftime('%d.%m.%Y');
+ $ref->{time} = $dt->strftime('%H:%M');
+ $ref->{epoch} = $dt->epoch;
$ref->{route_pre} = $ref->{sched_route_pre}
= [ split( qr{[|]}, $ref->{route_pre} // q{} ) ];
@@ -432,6 +433,7 @@ sub merge_with_departure {
# departure is preferred over arrival, so overwrite default values
$self->{date} = $result->{date};
$self->{time} = $result->{time};
+ $self->{epoch} = $result->{epoch};
$self->{datetime} = $result->{datetime};
$self->{train_id} = $result->{train_id};
$self->{train_no} = $result->{train_no};