Apply timezone to publication start date
authorThierry Florac <thierry.florac@onf.fr>
Fri, 13 Oct 2017 08:39:04 +0200
changeset 227 7a55458f64a7
parent 226 51a05a1f4212
child 228 f70686f44c7b
Apply timezone to publication start date
src/pyams_content/shared/common/zmi/workflow.py
--- a/src/pyams_content/shared/common/zmi/workflow.py	Fri Oct 13 08:38:32 2017 +0200
+++ b/src/pyams_content/shared/common/zmi/workflow.py	Fri Oct 13 08:39:04 2017 +0200
@@ -135,7 +135,7 @@
         if 'publication_effective_date' in self.widgets:
             widget = self.widgets['publication_effective_date']
             widget.required = True
-            widget_date = pub_info.publication_effective_date or datetime.now()
+            widget_date = tztime(pub_info.publication_effective_date or datetime.utcnow())
             widget.value = widget_date.strftime('%d/%m/%y %H:%M')
         if ('push_end_date' in self.widgets) and pub_info.push_end_date:
             self.widgets['push_end_date'].value = tztime(pub_info.push_end_date).strftime('%d/%m/%y %H:%M')