Unverified Commit e30c2f3b authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

Journey: Handle missing leading 0 in date strings.

Because of course it is missing, because the date string is treated as a
number by the magical API of the data lake, because why wouldn't it be.
parent 272f18d8
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -90,6 +90,12 @@ sub new {
	}

	my $date_ref = ( split( qr{[|]}, $jid ) )[4];
	if ( length($date_ref) < 7 ) {
		warn("HAFAS, not even once -- midnight crossing may be bogus");
	}
	if ( length($date_ref) == 7 ) {
		$date_ref = "0${date_ref}";
	}
	my $datetime_ref = DateTime::Format::Strptime->new(
		pattern   => '%d%m%Y',
		time_zone => 'Europe/Berlin'