mirror of
https://github.com/public-transport/db-vendo-client.git
synced 2025-02-23 07:09:35 +02:00
fix journey leg alternatives 🐛
- use realtime data if available - don't filter by departure station (HAFAS IDs are complicated)
This commit is contained in:
parent
c030724663
commit
d676b8430d
1 changed files with 2 additions and 2 deletions
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue