Closed benjamin-dk closed 7 years ago
@alex-bukach do you have a suggestion how to fix this?
@benjamin-dk does it display the time correctly at /admin/reports/opeka-invites?
@benjamin-dk nevermind, I see the issue. I will fix it.
@alex-bukach yes on the reports page the time is correct on /admin/reports/opeka-invites
- sorry for the misleading title of the issue.
@benjamin-dk fixed in https://github.com/cfdp/opeka/pull/101.
When a user saves a date, Drupal thinks the date is indicated in the user's timezone (or site timezone if users are not allowed to set own timezones). Thus Drupal converts it to timestamp (i.e. roughly speaking converts it to UTC time). Now, when showing the date&time at /admin/reports/opeka-invites, Drupal converts it back to a user timezone, and it displays properly.
However at /admin/opeka#invites it is nodejs that converts the time, and it uses server timezone, not Drupal user/site timezone. Thus if that two timezones were different, the value displayed at /admin/opeka#invites was incorrect.
Now I moved formatting date&time to client side and passed current Drupal user timezone there, so that it has a proper value. Also it allowed to translate the date to the user language there.
The Date & Time column on the
/admin/opeka#invites
path is not displaying the correct time on the production server. It is consistently two hours behind the time we set in the time field on the invitation form.It is probably related to the fact that the production server is located in Iceland and is running on the local time there, which is two hours behind Danish time.