stopover: default arrival & departure fields 🐛, >= for collecting journeys

This commit is contained in:
Jannis R 2018-03-29 02:45:15 +02:00
parent e8f21216a5
commit d96cbfb228
No known key found for this signature in database
GPG key ID: 0FE83946296A88A5
2 changed files with 4 additions and 2 deletions

View file

@ -153,7 +153,7 @@ const createClient = (profile, request = _request) => {
j = parse(j) j = parse(j)
journeys.push(j) journeys.push(j)
if (journeys.length === opt.results) { // collected enough if (journeys.length >= opt.results) { // collected enough
journeys.laterRef = d.outCtxScrF journeys.laterRef = d.outCtxScrF
return journeys return journeys
} }

View file

@ -5,7 +5,9 @@
const createParseStopover = (profile, stations, lines, remarks, date) => { const createParseStopover = (profile, stations, lines, remarks, date) => {
const parseStopover = (st) => { const parseStopover = (st) => {
const res = { const res = {
station: stations[parseInt(st.locX)] || null station: stations[parseInt(st.locX)] || null,
arrival: null,
departure: null
} }
if (st.aTimeR || st.aTimeS) { if (st.aTimeR || st.aTimeS) {
const arr = profile.parseDateTime(profile, date, st.aTimeR || st.aTimeS) const arr = profile.parseDateTime(profile, date, st.aTimeR || st.aTimeS)