diff options
author | Daniel Friesel <derf@finalrewind.org> | 2020-06-05 22:01:32 +0200 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2020-06-05 22:01:32 +0200 |
commit | cbbdf22f17eff7a717546eef136a0979a7b20c70 (patch) | |
tree | cfec3c9ba9674f42ad24a224fcb9a7bf2fbd8421 /lib/Travel/Status/DE/HAFAS.pm | |
parent | 10750ae5d92f19b264fe0793659a146c3b1d6c14 (diff) |
Support backends which recently switched to 4-digit years
What a time to be alive!
Diffstat (limited to 'lib/Travel/Status/DE/HAFAS.pm')
-rw-r--r-- | lib/Travel/Status/DE/HAFAS.pm | 6 |
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 |