Browse Source

Fix bug in computing arrival times

Due to reusing date time sequencer,
arrivals would all be set 1 day ahead.
master
Kenneth Bruen 2 years ago
parent
commit
b0cec37bd7
Signed by: kbruen
GPG Key ID: C1980A470C3EE5B1
  1. 3
      scraper/src/Scrapers/Station.cs

3
scraper/src/Scrapers/Station.cs

@ -89,9 +89,10 @@ namespace InfoferScraper.Scrapers {
).Groups as IEnumerable<Group>).Skip(1).Select(group => group.Value);
var (dateDay, (dateMonth, (dateYear, _))) = result.Date.Split('.').Select(int.Parse);
Utils.DateTimeSequencer dtSeq = new(dateYear, dateMonth, dateDay);
void ParseArrDepList(IElement element, Action<Action<StationArrDep>> adder) {
Utils.DateTimeSequencer dtSeq = new(dateYear, dateMonth, dateDay);
if (element.QuerySelector(":scope > div > ul") == null) return;
foreach (var trainElement in element.QuerySelectorAll(":scope > div > ul > li")) {

Loading…
Cancel
Save