Closed vonbarnekowa closed 5 years ago
Hi. What culture settings do you have in your installation? In my tests the date reflects the server time. Do you have any more info about your setup that might help? Are you able to compare the dates to those that come out of the umbracoLog
table, as that is the source of the data? Thanks!
My server timezone is Zürich, Zurich, Switzerland (UTC+1). When I go to the "History" section of a node, the time is correct. It's only in the plugin where the time is in advance. What seems strange, is that it worked before the time change last Sunday.
See here it's correct:
And via the plugin, it's wrong:
Here the row in the database:
Hi. So I looked into this more. As you may know Umbraco uses AngularJS framework in the back-office. There is a known issue with Angular formatting dates. So simply by formatting the date using Angular's built-in formatter it changes the timezone. Unfortunately Umbraco still uses an old version of Angular, so there is no built-in workaround in Angular.
Note that if you click into an item to view a log entry detail you can see the "correct" raw date shown underneath the heading in pale text (this doesn't use any Angular formatting).
I looked at the Umbraco source to see how they deal with it. Basically they have written their own date helper and formatter that deals with formatting based on the current user's timezone:
I could apply this function, but I'll need to work out which version of Umbraco this was added in and then look at putting it in the next release.
I've uploaded a new version (1.0.4) that should fix the UTC date issue:
Nuget: https://www.nuget.org/packages/Diplo.AuditLogViewer/1.0.4
Our: https://our.umbraco.com/packages/developer-tools/diplo-audit-log-viewer/
Let me know if this fixes your issue.
Will install your fix in our dev environment and give you a feedback. I close this issue temporarily.
Dates are written in UTC+2. It would be nice if it changes according to the server time.