formerScheduled… -> scheduled… 💥

This commit is contained in:
Jannis R 2019-02-14 14:04:31 +01:00
parent 16461733e4
commit 7e39a2f333
No known key found for this signature in database
GPG key ID: 0FE83946296A88A5
3 changed files with 8 additions and 8 deletions

View file

@ -41,7 +41,7 @@ const createParseArrOrDep = (profile, opt, data, prefix) => {
const pR = d.stbStop[prefix + 'PlatfR'] const pR = d.stbStop[prefix + 'PlatfR']
const pP = d.stbStop[prefix + 'PlatfS'] const pP = d.stbStop[prefix + 'PlatfS']
res.platform = pR || pP || null res.platform = pR || pP || null
if (pR && pP && pR !== pP) res.formerScheduledPlatform = pP if (pR && pP && pR !== pP) res.scheduledPlatform = pP
// todo: DRY with parseStopover // todo: DRY with parseStopover
// todo: DRY with parseJourneyLeg // todo: DRY with parseJourneyLeg
@ -49,7 +49,7 @@ const createParseArrOrDep = (profile, opt, data, prefix) => {
res.cancelled = true res.cancelled = true
Object.defineProperty(res, 'canceled', {value: true}) Object.defineProperty(res, 'canceled', {value: true})
res.when = res.delay = null res.when = res.delay = null
res.formerScheduledWhen = profile.parseDateTime(profile, d.date, tP, tz) res.scheduledWhen = profile.parseDateTime(profile, d.date, tP, tz)
} }
if (opt.remarks) { if (opt.remarks) {

View file

@ -162,12 +162,12 @@ const createParseJourneyLeg = (profile, opt, data) => {
if (pt.arr.aCncl) { if (pt.arr.aCncl) {
res.arrival = res.arrivalPlatform = res.arrivalDelay = null res.arrival = res.arrivalPlatform = res.arrivalDelay = null
const arr = profile.parseDateTime(profile, j.date, pt.arr.aTimeS, pt.arr.aTZOffset) const arr = profile.parseDateTime(profile, j.date, pt.arr.aTimeS, pt.arr.aTZOffset)
res.formerScheduledArrival = arr res.scheduledArrival = arr
} }
if (pt.dep.dCncl) { if (pt.dep.dCncl) {
res.departure = res.departurePlatform = res.departureDelay = null res.departure = res.departurePlatform = res.departureDelay = null
const dep = profile.parseDateTime(profile, j.date, pt.dep.dTimeS, pt.dep.dTZOffset) const dep = profile.parseDateTime(profile, j.date, pt.dep.dTimeS, pt.dep.dTZOffset)
res.formerScheduledDeparture = dep res.scheduledDeparture = dep
} }
} }

View file

@ -39,10 +39,10 @@ const createParseStopover = (profile, opt, data, date) => {
} }
if (st.aPlatfR && st.aPlatfS && st.aPlatfR !== st.aPlatfS) { if (st.aPlatfR && st.aPlatfS && st.aPlatfR !== st.aPlatfS) {
res.formerScheduledArrivalPlatform = st.aPlatfS res.scheduledArrivalPlatform = st.aPlatfS
} }
if (st.dPlatfR && st.dPlatfS && st.dPlatfR !== st.dPlatfS) { if (st.dPlatfR && st.dPlatfS && st.dPlatfR !== st.dPlatfS) {
res.formerScheduledDeparturePlatform = st.dPlatfS res.scheduledDeparturePlatform = st.dPlatfS
} }
// mark stations the train passes without stopping // mark stations the train passes without stopping
@ -58,7 +58,7 @@ const createParseStopover = (profile, opt, data, date) => {
res.arrival = res.arrivalDelay = null res.arrival = res.arrivalDelay = null
if (st.aTimeS) { if (st.aTimeS) {
const arr = profile.parseDateTime(profile, date, st.aTimeS, st.aTZOffset) const arr = profile.parseDateTime(profile, date, st.aTimeS, st.aTZOffset)
res.formerScheduledArrival = arr res.scheduledArrival = arr
} }
} }
if (st.dCncl) { if (st.dCncl) {
@ -66,7 +66,7 @@ const createParseStopover = (profile, opt, data, date) => {
res.departure = res.departureDelay = null res.departure = res.departureDelay = null
if (st.dTimeS) { if (st.dTimeS) {
const arr = profile.parseDateTime(profile, date, st.dTimeS, st.dTZOffset) const arr = profile.parseDateTime(profile, date, st.dTimeS, st.dTZOffset)
res.formerScheduledDeparture = arr res.scheduledDeparture = arr
} }
} }
} }