Commit 67040d64 authored by Volker Krause's avatar Volker Krause
Browse files

Improve DB arrival platform parsing

Very long platform names and international ticket layout could cause this
to not be properly separated.
parent b2eeae2f
Pipeline #201424 passed with stage
in 2 minutes and 21 seconds
......@@ -46,7 +46,7 @@ function parseArrival(res, line, year) {
res.reservationFor.arrivalStation.name = arr[1];
res.reservationFor.arrivalTime = JsonLd.toDateTime(arr[2] + ' ' + arr[3] + ' ' + year + ' ' + arr[4], "dd MM yyyy hh:mm", "de");
var idx = arr.index + arr[0].length;
var platform = line.substr(idx).match(/^ {1,3}(.*?)(?=( | IC|$))/);
var platform = line.substr(idx).match(/^ {1,3}(.*?)(?=( | IC| \d Fenster| \d Gang|$))/);
if (platform) {
idx += platform.index + platform[0].length;
res.reservationFor.arrivalPlatform = platform[1];
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment