Commit 279f704a authored by Volker Krause's avatar Volker Krause
Browse files

Fix off by one date in certain SNCF tickets

The problem here is that the way we extracted the date from a JS Date
object was prone to timezone conversion rounding errors, possibly giving
us a day before or after as well. We fix this by letting the post-processor
deal with the problem for us.
parent 102d8aff
Pipeline #61662 passed with stages
in 8 minutes and 41 seconds
......@@ -216,10 +216,10 @@ function parseSecutixPdfItineraryV2(text, res)
var leg = JsonLd.newTrainReservation();
leg.reservationFor.departureStation.name = data[2];
var date = res.reservationFor.departureDay.toISOString().substr(0, 10);
leg.reservationFor.departureTime = JsonLd.toDateTime(date + data[1], "yyyy-MM-ddhh'h'mm", "fr");
leg.reservationFor.departureDay = res.reservationFor.departureDay;
leg.reservationFor.departureTime = JsonLd.toDateTime(data[1], "hh'h'mm", "fr");
leg.reservationFor.arrivalStation.name = data[5];
leg.reservationFor.arrivalTime = JsonLd.toDateTime(date + data[4], "yyyy-MM-ddhh'h'mm", "fr");
leg.reservationFor.arrivalTime = JsonLd.toDateTime(data[4], "hh'h'mm", "fr");
leg.reservationFor.trainNumber = data[3];
leg.underName = res.underName;
leg.reservationNumber = res.reservationNumber;
......
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