mirror of
https://github.com/public-transport/db-vendo-client.git
synced 2025-02-23 15:19:35 +02:00
parseStopover: fix first/last canceled stopovers 🐛
[ci skip]
This commit is contained in:
parent
bb6e42a662
commit
440ed6d1fb
2 changed files with 12 additions and 4 deletions
|
@ -31,6 +31,10 @@ This version is not fully backwords-compatible. Check out [the migration guide](
|
||||||
- 8881d8a & b6fbaa5: change parsers signature to `parse…(profile, opt, data)`
|
- 8881d8a & b6fbaa5: change parsers signature to `parse…(profile, opt, data)`
|
||||||
- cabe5fa: option to parse & expose `station.lines`, default off
|
- cabe5fa: option to parse & expose `station.lines`, default off
|
||||||
|
|
||||||
|
### bugfixes
|
||||||
|
|
||||||
|
- dd0a9b2 `parseStopover`: fix first/last canceled stopovers 🐛
|
||||||
|
|
||||||
## `2.7.0`
|
## `2.7.0`
|
||||||
|
|
||||||
- `journeys()`: `polylines` option
|
- `journeys()`: `polylines` option
|
||||||
|
|
|
@ -49,15 +49,19 @@ const createParseStopover = (profile, opt, data, date) => {
|
||||||
Object.defineProperty(res, 'canceled', {value: true})
|
Object.defineProperty(res, 'canceled', {value: true})
|
||||||
if (st.aCncl) {
|
if (st.aCncl) {
|
||||||
res.arrival = res.arrivalDelay = null
|
res.arrival = res.arrivalDelay = null
|
||||||
|
if (st.aTimeS) {
|
||||||
const arr = profile.parseDateTime(profile, date, st.aTimeS)
|
const arr = profile.parseDateTime(profile, date, st.aTimeS)
|
||||||
res.formerScheduledArrival = arr.toISO()
|
res.formerScheduledArrival = arr.toISO()
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (st.dCncl) {
|
if (st.dCncl) {
|
||||||
res.departure = res.departureDelay = null
|
res.departure = res.departureDelay = null
|
||||||
|
if (st.dTimeS) {
|
||||||
const arr = profile.parseDateTime(profile, date, st.dTimeS)
|
const arr = profile.parseDateTime(profile, date, st.dTimeS)
|
||||||
res.formerScheduledDeparture = arr.toISO()
|
res.formerScheduledDeparture = arr.toISO()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (opt.remarks && Array.isArray(st.msgL)) {
|
if (opt.remarks && Array.isArray(st.msgL)) {
|
||||||
res.remarks = []
|
res.remarks = []
|
||||||
|
|
Loading…
Add table
Reference in a new issue