parseStopover: fix first/last canceled stopovers 🐛

cherry-picked 440ed6d from next
This commit is contained in:
Jannis R 2018-06-28 16:34:49 +02:00
parent a952b08b76
commit 063e2b4254
No known key found for this signature in database
GPG key ID: 0FE83946296A88A5

View file

@ -44,15 +44,19 @@ const createParseStopover = (profile, stations, lines, remarks, date) => {
Object.defineProperty(res, 'canceled', {value: true})
if (st.aCncl) {
res.arrival = res.arrivalDelay = null
if (st.aTimeS) {
const arr = profile.parseDateTime(profile, date, st.aTimeS)
res.formerScheduledArrival = arr.toISO()
}
}
if (st.dCncl) {
res.departure = res.departureDelay = null
if (st.dTimeS) {
const arr = profile.parseDateTime(profile, date, st.dTimeS)
res.formerScheduledDeparture = arr.toISO()
}
}
}
return res
}