Ignored user time zone for poll closeDate display

AI-generated summary

The poll close date display in Discourse is not considering the user’s time zone, instead showing the server time zone. This is a minor UX issue, but it can cause confusion, especially when conducting binding votes. benkeks reported the issue and provided a quick fix by adding .local() in the display widget JS. codinghorror brought it to the attention of the developers, and joffreyjaffeux agreed to look into it. A fix was later implemented in this pull request by joffreyjaffeux.

The close date of polls that is displayed when hovering the “Closes in …” info prior to closing time seems to be rendered in the server time zone.

One would rather expect it to be displayed in the same time zone as surrounding time info (e.g. the post date).

In the following poll, I set close=2020-05-01T18:00CEST. The hover title should thus render consistent with 2020-05-01T16:00:00Z. (For me, it says 4:00 PM instead of 6:00 PM.)

  • option1
  • option2
0 voters

This might seem like a minor ux glitch. But as we are currently conducting binding votes in my community using this feature, it’s quite annoying to have “wrong” end times. I quick-fixed it for my instance by adding a .local() in the display widget JS at:

https://github.com/discourse/discourse/blob/master/plugins/poll/assets/javascripts/widgets/discourse-poll.js.es6#L750

(But I’m not sufficiently familiar with Discourse to tell whether this is actually the right fix. :grimacing:)

2 Likes

cc @j.jaffeux perhaps?

3 Likes

Sure can have a look, don’t know this code, but seems very straightforward, will fix by next week.

3 Likes

That should fix it

https://github.com/discourse/discourse/pull/9656

3 Likes

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.