parse scheduled/actual platform information on legs

fixes #116
This commit is contained in:
Julius Tens 2019-05-29 14:10:12 +02:00 committed by Jannis Redmann
parent f92e9336c0
commit 875ea18b4c

View file

@ -94,8 +94,15 @@ const createParseJourneyLeg = (profile, opt, data) => {
res.line = lines[parseInt(pt.jny.prodX)] || null res.line = lines[parseInt(pt.jny.prodX)] || null
res.direction = pt.jny.dirTxt && profile.parseStationName(pt.jny.dirTxt) || null res.direction = pt.jny.dirTxt && profile.parseStationName(pt.jny.dirTxt) || null
if (pt.dep.dPlatfS) res.departurePlatform = pt.dep.dPlatfS res.arrivalPlatform = pt.arr.aPlatfR ||pt.arr.aPlatfS || null
if (pt.arr.aPlatfS) res.arrivalPlatform = pt.arr.aPlatfS if (pt.arr.aPlatfR && pt.arr.aPlatfS && pt.arr.aPlatfR !== pt.arr.aPlatfS) {
res.scheduledArrivalPlatform = pt.arr.aPlatfS
}
res.departurePlatform = pt.dep.dPlatfR || pt.dep.dPlatfS || null
if (pt.dep.dPlatfR && pt.dep.dPlatfS && pt.dep.dPlatfR !== pt.dep.dPlatfS) {
res.scheduledDeparturePlatform = pt.dep.dPlatfS
}
if (parseStopovers && pt.jny.stopL) { if (parseStopovers && pt.jny.stopL) {
const parse = profile.parseStopover(profile, opt, data, j.date) const parse = profile.parseStopover(profile, opt, data, j.date)