From d676b8430d550b37367b3a8435fb2462dcfde32b Mon Sep 17 00:00:00 2001 From: Jannis R Date: Sun, 29 Apr 2018 13:41:21 +0200 Subject: [PATCH] fix journey leg alternatives :bug: - use realtime data if available - don't filter by departure station (HAFAS IDs are complicated) --- parse/journey-leg.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/parse/journey-leg.js b/parse/journey-leg.js index 30477270..8e7b054a 100644 --- a/parse/journey-leg.js +++ b/parse/journey-leg.js @@ -58,15 +58,15 @@ const createParseJourneyLeg = (profile, stations, lines, remarks) => { if (pt.jny.freq && pt.jny.freq.jnyL) { const parseAlternative = (a) => { - const t = a.stopL[0].dTimeS || a.stopL[0].dTimeR + const t = a.stopL[0].dTimeR || a.stopL[0].dTimeS const when = profile.parseDateTime(profile, j.date, t) + // todo: expose a.stopL[0] return { line: lines[parseInt(a.prodX)] || null, when: when.toISO() } } res.alternatives = pt.jny.freq.jnyL - .filter(a => a.stopL[0].locX === pt.dep.locX) .map(parseAlternative) } }