Incubator-superset: Timestamps are not displayed in the client's local timezone

Created on 22 Nov 2017  路  7Comments  路  Source: apache/incubator-superset

Timestamp does not display in the local timezone of the client viewing the visualization.

Superset version

all/ 0.20.3

Expected results

Times in timeseries charts should be displayed in the local timezone of the client.

Actual results

It displays whatever data is retrieved as is without any changes to it.

Steps to reproduce

  1. Add some data in druid
  2. Try to do a simple timeseries visualization
  3. Notice that the timestamp does not have any timezone info nor does it convert it to the clients local timezone (if the timestamp is in UTC format)
inactive

Most helpful comment

I made these changes : https://github.com/am-kram/incubator-superset/commit/8f7a11209753eeb6d5ca5de6b9cdebb3bb9c6d86 (and confirmed it works - all timestamps are changed from epoch to UTC - by using moment and a custom utc function)
but I don't want to PR this - I'd like to add a setting in the UI (a toggle for chart options). The above change works for me - but if someone wants to see it in UTC - the above is not helpful.

How do I wire the control to the event and make it render on the UI ?I took a quick look can't tell for sure - any pointers on how the ui lifecycle is controlled and how one can add widgets etc., on the UI ?

All 7 comments

Interesting, we can leverage pandas to do the grunt work https://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.tz_convert.html

will give it a go this weekend!

I was looking at the data sent by the server - it sends in epochs (as I would expect).
The client (javascript) changes this to UTC - can someone ( @xrmx ) kindly point me to instructions on how to run a "dev" version of superset locally , so that I can fix the issue in JS to add a setting to render this in the local timezone of the user viewing it ?

Check out the CONTRIBUTING.md file in the repo.

I made these changes : https://github.com/am-kram/incubator-superset/commit/8f7a11209753eeb6d5ca5de6b9cdebb3bb9c6d86 (and confirmed it works - all timestamps are changed from epoch to UTC - by using moment and a custom utc function)
but I don't want to PR this - I'd like to add a setting in the UI (a toggle for chart options). The above change works for me - but if someone wants to see it in UTC - the above is not helpful.

How do I wire the control to the event and make it render on the UI ?I took a quick look can't tell for sure - any pointers on how the ui lifecycle is controlled and how one can add widgets etc., on the UI ?

Hi, Was this change merged into master ?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kalimuthu123 picture kalimuthu123  路  3Comments

eliab picture eliab  路  3Comments

ylkjick532428 picture ylkjick532428  路  3Comments

josephtyler picture josephtyler  路  3Comments

deity-bram picture deity-bram  路  3Comments