summaryrefslogtreecommitdiff
path: root/lib/Travel
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Travel')
-rw-r--r--lib/Travel/Status/DE/HAFAS.pm6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/Travel/Status/DE/HAFAS.pm b/lib/Travel/Status/DE/HAFAS.pm
index 39621d5..847be90 100644
--- a/lib/Travel/Status/DE/HAFAS.pm
+++ b/lib/Travel/Status/DE/HAFAS.pm
@@ -328,7 +328,11 @@ sub results {
push( @messages, $n->getAttribute('header') );
}
- substr( $date, 6, 0, '20' );
+ # Some backends report dd.mm.yy, some report dd.mm.yyyy
+ # -> map all dates to dd.mm.yyyy
+ if ( length($date) == 8 ) {
+ substr( $date, 6, 0, '20' );
+ }
# TODO the first charactor of delayReason is special:
# " " -> no additional data, rest (if any) is delay reason