bahn.guru icon indicating copy to clipboard operation
bahn.guru copied to clipboard

Time traveling is possible

Open UnlimitedCookies opened this issue 1 year ago • 1 comments

image

The link: https://bahn.guru/day?origin=HAMBURG&destination=K%C3%96LN&class=1&bc=2&age=Y&date=04.07.2023

What happened here?

UnlimitedCookies avatar Jun 26 '23 22:06 UnlimitedCookies

Heyho,

I figured out that it's not a bug in bahn.guru, but in hafas-client. The bug happens when:

  • A travel starts at one date and ends at another date, and
  • One part of the journey (a "leg") is completely in the next date.
    • In your case, there is probably one travel from Hamburg to Cologne on 2023-07-04, and then within Cologne another travel which starts and ends on 2023-07-05.

In this case, the parts of the journey that are taking place on the next day, are reported by hafas-client to happen on your departure day. Therefore, it looks to bahn.guru as if the journey ended in the early morning of your departure day.

I've opened an issue over at hafas-client and created a test which reproduces the bug, but I'm not yet sure how to fix it: https://github.com/public-transport/hafas-client/issues/301

soerface avatar Nov 13 '23 14:11 soerface