Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timezone problem in Web UI #547

Open
matteoferrux opened this issue Sep 23, 2024 · 2 comments
Open

Timezone problem in Web UI #547

matteoferrux opened this issue Sep 23, 2024 · 2 comments

Comments

@matteoferrux
Copy link

Hi,
I have installed my own instance of MOTIS (and how wonderful is it!) and when I make a search I always have a difference of two hours between the search and the results.

image

I've already set default_timezone in Nigiri
image

Do you have a solution ?
Thanks !

@felixguendling
Copy link
Member

The reason is that the UI tries to provide an overview of a time interval.

Currently, the initial query time interval is [t-1h, t+1h], so 1h around the time you gave to it:

initialRequest minConnectionCount from to date searchDirection =
let
selectedTime =
unixTime date
startTime =
selectedTime - 3600
endTime =
selectedTime + 3600
in
{ from = from
, to = to
, intervalStart = startTime
, intervalEnd = endTime
, minConnectionCount = minConnectionCount
, searchDirection = searchDirection
, extendIntervalEarlier = True
, extendIntervalLater = True
}

If the initial interval doesn't contain min_connection_count connections, the interval will be extended in both directions (earlier + later).

We're working on a new UI where the logic is a little bit different: it will also give you an interval, however the interval will start at the time you provided in case it's a departure time. If it's an arrival time it will end at this time.

Since the current UI is deprecated, I won't put any effort to improve it in order to be able to focus on the new UI. If anyone wants to replicate the logic of the new UI into the old, I am open to merge PRs. Just beware that this UI will be replaced.

@felixguendling
Copy link
Member

Ah. Maybe I should've started with: "That's currently the expected behavior"
(but the next version of the UI has it already fixed from the beginning)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants