-
-
Notifications
You must be signed in to change notification settings - Fork 32
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
1letter/fix #178 #254
base: master
Are you sure you want to change the base?
1letter/fix #178 #254
Conversation
- used via ajax call in folder_content view - use the IPublication Adapter for settings correct datetime - respect the portal timezone settings - remove unused imports
@1letter thanks for creating this Pull Request and helping to improve Plone! TL;DR: Finish pushing changes, pass all other checks, then paste a comment:
To ensure that these changes do not break other parts of Plone, the Plone test suite matrix needs to pass, but it takes 30-60 min. Other CI checks are usually much faster and the Plone Jenkins resources are limited, so when done pushing changes and all other checks pass either start all Jenkins PR jobs yourself, or simply add the comment above in this PR to start all the jobs automatically. Happy hacking! |
This mixes the currently stored DateTime with the newly stored datetime. I agree we need to store datetime with timezone everywhere, so for created, modified, effective and expiration. But this gets complex. Just changing it in one place seems dangerous to me. Any opinions? |
As release manager I get nervous when I see such a change during beta... |
There is no issue, just store a timezone as pytz (never as offset) with the datetime and all is fine. |
Changing this is a a PLIP and is complex, so IMO for a 6.1: ok. But not now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As the IPublication
schema uses for it's fields zope.schema.Datetime
which is based on Python's datetime
, this would change the publication dates from DateTime
objects to datetime
. As others already said, this change would be big win but for Plone 6.1, even if we could consider this a bugfix because the current behavior is inconsistent and broken.
But I do not see how the portal's timezone would be used here. You are stripping the timezone information from the date objects. Out of my head you would need to use something like this:
from plone.app.event.base import default_timezone
from plone.event.utils import pydt
from plone.app.dexterity.behaviors.metadata import IPublication
publication = IPublication(obj, None)
if publication:
publication.effective = pydt(datetime.strptime(self.effectiveDate, "%Y-%m-%dT%H:%M"), missing_zone=default_timezone(obj, as_tzinfo=True))
Also, we probable need to adapt this in other places too.
But overall, this would be a big win and is actually necessary.
@erral the discussion from the 2018 Bonn sprint is here: plone/plone.restapi#493 |
Fix datetime settings in fc-properties view