HSLdevcom / digitransit-ui

Digitransit UI ("Reittiopas.fi")
https://www.reittiopas.fi/
Other
237 stars 130 forks source link

DT-6339 render time in forced time zone #5010

Closed vesameskanen closed 1 month ago

vesameskanen commented 1 month ago

New PlanConnection time values were parsed using Date object's toTimeString() method, which always outputs local time zone. This is wrong: the client should display itineraries using the time zone which matches the routing data and request parameters.

Now UI primarily parses time of day from the original datetime strings coming from OTP. In some rare cases, hh:mm is extracted from epoch time using a new epochToTime() utility, which gets the forced time zone from the configuration.

In addition, following two fixes are included: