Commit d18dae5e authored by Volker Krause's avatar Volker Krause
Browse files

Fix extracting Renfe train names from newer PDF tickets

parent 5b179138
Pipeline #157073 passed with stages
in 1 minute and 40 seconds
......@@ -49,7 +49,7 @@ function parsePdf(pdf, node, triggerNode)
res.reservationFor.departureStation.name = dep[1];
res.reservationFor.departureTime = JsonLd.toDateTime(dep[2] + dep[3], "dd/MM/yyyyhh:mm", "es");
var arr = text.match(/(?:Llegada|Destino:)\s+(.*?) {2,}([\d\/]+) +(\d\d:\d\d)\n *(\S+) /);
var arr = text.match(/(?:Llegada|Destino:)\s+(.*?) {2,}([\d\/]+) +(\d\d:\d\d)\n(?:.* )?([A-Z]+) +(\d+)/);
res.reservationFor.arrivalStation.name = arr[1];
res.reservationFor.arrivalTime = JsonLd.toDateTime(arr[2] + arr[3], "dd/MM/yyyyhh:mm", "es");
res.reservationFor.trainName = arr[4];
......
Markdown is supported
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