-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
This is a collection of comments related to handling timezones within OTP. I submitted PR #2595 which spawned some discussion.
@t2gran noted that this approach was perhaps not ideal
TimeZone decoration is a candidate for a pluggable module - there is a lot of different strategies which might be suitable in different scenarios. I am a bit skeptical to using a client based parameter. I think the right way forward is to create an issue for this - so we can discuss what would be the best solution.
And suggested adding timezones to router-config.json.
@abyrd provided some additional context for the issue.
OTP was originally built without much concern for timezones as it was used at first in single cities. Of couse as time went on some people started making networks that crossed time zone boundaries. But even in single time zone graphs, the client (web browser), the server, and the graph itself can all be in different time zones, and we have never gone through a design process where we spelled out the expected behavior in all these cases. Although it's tempting to just ask the client to specify an exact timezone, in other cases the client just wants to use the timezone of the location visible in the map. We should probably never default to / use the timezone of the server, but in Java it's easy for that to happen by mistake.
And (if I'm reading correctly) added additional support for at least specifying a timezone in router-config.json
I also started a discussion outside of GitHub here.
The two proposals I see are thus
- Allow API clients to include a timezone parameter
- Force a timezone in
router-config.json
More can be added as they are proposed