-
-
Notifications
You must be signed in to change notification settings - Fork 243
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
Use home's location timezone instead of client's one in UI #1537
Comments
This is indeed a problem. The persistence endpoint returns epoch-based timestamps which are not fixed to a timezone.
So they are sent as local time by the server and interpreted as local time by the client (the UI). It's a bit convoluted to figure out if the timezones are different and perform the conversion (the server's timezone isn't always accessible). ECharts has an open issue about this: apache/echarts#14453 Alternatively, one of these could be sent along with the request to the persistence endpoint to make the server aware of the client's timezone: so it could take it into account and return timestamps converted to the client's timezone. There is no HTTP request header automatically sent by browsers which includes the local timezone so it would have to be in the request body's payload. Of course, ideally proper timezone-aware date strings could be returned in these Also note that charts without a fixed period - so-called "dynamic" periods - always end by default to the current date & time, in the local timezone, in this case it might not match the end of the historical data. @openhab/core-maintainers wdyt? |
I think we have to relay on time zone set here settings/services/org.openhab.i18n and use this time zone to show datetime, as well to show 12/24 hours This is not only related to analyzer view, also schedule (/settings/schedule/) view affected by this issue |
This is what I meant by "not always accessible"; |
I don't think this is correct. If I understand the code the timestamps are always epoch timestamps which denote a certain point in time (relative to 1970-01-01 00:00:00 UTC). So the client can always convert them to the timezone that is needed, without knowing the server timestamp. Also the
For charts we should probably transmit a timezone that shall be used. |
The problem
See topic here https://community.openhab.org/t/oh3-main-ui-taking-into-account-server-time-zone-not-browser-time-zone/140177
Expected behavior
Shows all graphs in home's location time zone and do not take into account the computer timezone
Steps to reproduce
Your environment
Browser console
Browser network traffic
Additional information
The text was updated successfully, but these errors were encountered: