Added visible publication date attribute
authorThierry Florac <thierry.florac@onf.fr>
Thu, 12 Jul 2018 10:53:05 +0200
changeset 84 3ff493ee3ea5
parent 83 8327203905fd
child 85 c92e09a71821
Added visible publication date attribute
src/pyams_workflow/content.py
--- a/src/pyams_workflow/content.py	Mon Jul 09 14:06:28 2018 +0200
+++ b/src/pyams_workflow/content.py	Thu Jul 12 10:53:05 2018 +0200
@@ -143,6 +143,14 @@
             del IZopeDublinCore(self.__parent__)._mapping['Date.Expires']
         self._publication_expiration_date = value
 
+    @property
+    def visible_publication_date(self):
+        displayed_date = self.displayed_publication_date
+        if displayed_date == DISPLAY_FIRST_VERSION:
+            return self.first_publication_date
+        else:
+            return self.publication_date
+
     def reset(self, complete=True):
         self._publication_date = None
         self._first_publication_date = None