-
-
Notifications
You must be signed in to change notification settings - Fork 573
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrong Time displayed in DateTimeWidget #2597
Comments
@nzambello could you have a look here please? It seems this might have something to do with your code from: https://github.com/plone/volto/blob/master/src/helpers/Utils/Utils.js#L155 |
I did some further research and it might actually be a problem with Plone REST API. checking the returned value for "effective" on an item published at 2021-08-02T12:47:15 GMT+2 (German local time) returns an effective date of "2021-08-02T12:47:15" without any Timezone reference. |
@buchi I saw you implemented some stuff regarding DateTime in p.restapi. This comment seems to sum up the issue we are having: https://github.com/plone/plone.restapi/blob/02421afe76b53414ee569bb42077248b45d6e8e8/src/plone/restapi/deserializer/dxfields.py#L96 Can you maybe explain why this is? Looking at the portal_catalog the time zone information we need is stored in the object: |
As metioned by @nzambello i could have found a possible solution. The problem is that for effective and expires there are custom field setter and getter that strips timezone infos for some reasons related to z3cform widgets i think. The problem is that when Volto post that date, it is a UTC string. With my patch i simply "localize" the date in deserializer to be able to pass the correct hour to the setter. I don't know if this could be a good solution to be moved into plone.restapi (i made these changes only for these two fields). |
Describe the bug
The wrong time is displayed in the effective date field after a document has been published.
To Reproduce
Steps to reproduce the behavior:
-> Effective Date Time in Sidebar is not your local time
Expected behavior
Time in Effective Date field in the edit sidebar should correspond with your local time
Screenshots
Actual local time of publishment was 10:41
Software (please complete the following information):
Additional context
The correct time seems to be saved in Plone, but the parsing it back in the frontend seems to go wrong. I suspect the problem to occur either in:
volto/src/helpers/Utils/Utils.js
Line 155 in ec8ee39
or with the rc-time-picker itself
The text was updated successfully, but these errors were encountered: