gstein commented on issue #49:
URL: https://github.com/apache/steve/issues/49#issuecomment-3673625919

   The two columns "open_at" and "close_at" in the "elections" table (see 
schema.sql). These columns are set via UPDATE statements (see queries.yaml). 
The function unixepoch() is used. I don't know what time zone is being used for 
that.
   
   The epoch seconds are formatted into human-readable times in 
pages.py:postprocess_election(). That code formats on the server-side 
regardless of the browser's time zone information. I believe the browser time 
zone is in the request header (or can be inferred from a date/time in the 
header), which could then be used to shift the open_at and close_at formatting 
to the correct time zone.
   
   It is arguable to do the time zone shift and formatting on the client side, 
but that would seem to require the addition of a new JS library and the 
associated JS code/complexity to do the formatting (rather than simple EZT 
template variable insertion on the server's side).
   
   ... Okay. I just did a quick search. There is no such request header 
(primarily: privacy concern). So TZ adjustments must be done in JS on the 
client. I haven't done this before, so have no recommendations. I'm sure there 
are libraries that we can grab and place/serve from v3/server/static/js/ ... 
the server should ensure any time value is passed to the client in UTC.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to