From d96cbfb228a2ebbce5aaccbd59b420f160a8f9a8 Mon Sep 17 00:00:00 2001 From: Jannis R Date: Thu, 29 Mar 2018 02:45:15 +0200 Subject: [PATCH] stopover: default arrival & departure fields :bug:, >= for collecting journeys --- index.js | 2 +- parse/stopover.js | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 75ddf42a..7d0482b7 100644 --- a/index.js +++ b/index.js @@ -153,7 +153,7 @@ const createClient = (profile, request = _request) => { j = parse(j) journeys.push(j) - if (journeys.length === opt.results) { // collected enough + if (journeys.length >= opt.results) { // collected enough journeys.laterRef = d.outCtxScrF return journeys } diff --git a/parse/stopover.js b/parse/stopover.js index 2a445bd6..86d12726 100644 --- a/parse/stopover.js +++ b/parse/stopover.js @@ -5,7 +5,9 @@ const createParseStopover = (profile, stations, lines, remarks, date) => { const parseStopover = (st) => { const res = { - station: stations[parseInt(st.locX)] || null + station: stations[parseInt(st.locX)] || null, + arrival: null, + departure: null } if (st.aTimeR || st.aTimeS) { const arr = profile.parseDateTime(profile, date, st.aTimeR || st.aTimeS)