departures, arrivals, stopovers: former scheduled platform(s)

This commit is contained in:
Jannis R 2018-07-09 13:12:26 +02:00
parent 0199749a31
commit 0d5a8fab1b
No known key found for this signature in database
GPG key ID: 0FE83946296A88A5
2 changed files with 8 additions and 1 deletions

View file

@ -39,7 +39,7 @@ const createParseArrOrDep = (profile, opt, data, prefix) => {
const pR = d.stbStop[prefix + 'PlatfR']
const pP = d.stbStop[prefix + 'PlatfS']
res.platform = pR || pP || null
// todo: `formerScheduledPlatform`
if (pR && pP && pR !== pP) res.formerScheduledPlatform = pP
// todo: DRY with parseStopover
// todo: DRY with parseJourneyLeg

View file

@ -39,6 +39,13 @@ const createParseStopover = (profile, opt, data, date) => {
res.departureDelay = Math.round((realtime - planned) / 1000)
}
if (st.aPlatfR && st.aPlatfS && st.aPlatfR !== st.aPlatfS) {
res.formerScheduledArrivalPlatform = st.aPlatfS
}
if (st.dPlatfR && st.dPlatfS && st.dPlatfR !== st.dPlatfS) {
res.formerScheduledDeparturePlatform = st.dPlatfS
}
// mark stations the train passes without stopping
if(st.dInS === false && st.aOutS === false) res.passBy = true