parseJourneyLeg: parse freq.numC

This commit is contained in:
Jannis R 2018-12-02 01:05:01 +01:00 committed by Jannis Redmann
parent 1ebb958b4a
commit 17b8f1485f

View file

@ -118,13 +118,16 @@ const createParseJourneyLeg = (profile, opt, data) => {
} }
const freq = pt.jny.freq || {} const freq = pt.jny.freq || {}
// todo: expose `res.cycle` even if only one field exists (breaking)
if (freq.minC && freq.maxC) { if (freq.minC && freq.maxC) {
// todo: what is freq.numC?
res.cycle = { res.cycle = {
min: freq.minC * 60, min: freq.minC * 60,
max: freq.maxC * 60 max: freq.maxC * 60
} }
// nr of connections in this frequency, from now on
if (freq.numC) res.cycle.nr = freq.numC
} }
if (freq.jnyL) { if (freq.jnyL) {
const parseAlternative = (a) => { const parseAlternative = (a) => {
const t = a.stopL[0].dTimeR || a.stopL[0].dTimeS const t = a.stopL[0].dTimeR || a.stopL[0].dTimeS