I would like my page to show the actual publication and modified dates and times and not how many minutes, days or months ago since the publication or modified dates:
At the moment, this is showing up on my pages in Plone:
by awong — published 41 minutes ago, last modified 41 minutes ago
Is there a way I could display the actual date and time in Plone? Any advise would be most appreciated. Thanks so much.
Plone 5.0.8 (5018)
Python 2.7.12 (default, Nov 19 2016, 06:48:10) [GCC 5.4.0 20160609]
PIL 3.4.2 (Pillow)
You can find some more info here: http://plone.github.io/mockup/dev/#pattern/moment
I think this should be configurable by default; do you mind to open an issue on Plone's issue tracker?
espenmn and hvelarde, thank you so much.
I could change the template and got the result I wanted. However, I am having issues overriding the default through my theme product. My customized template is at zeocluster/src/mytheme.name/src/mytheme/name/browser/templates/plone.app.layout.viewlets.document_byline.pt
This is what I have in my zeocluster/src/mytheme.name/src/mytheme/name/browser/configure.zcml:
<!-- Set overrides folder for Just-a-Bunch-Of-Templates product -->
<include package="z3c.jbot" file="meta.zcml" />
<!-- Publish static files -->
I keep getting this error:
ConfigurationError: ('Invalid value for', 'layer', "ImportError: Couldn't import mytheme.name.browser.interfaces, No module named interfaces")
Am I missing something? Any advise would be most appreciated. Thank you so much.
in the folder my theme/name/browser you need a file called interfaces.py, and in that file you need to define the 'layer',
Maybe it helps looking here:
You might also need (to put it here):
This is awesome! Thank you so much, espenmn. This is what I did:
Created an interface.py file in the /browser folder and put the following code:
from plone.theme.interfaces import IDefaultPloneLayer
"""Marker interface that defines a Zope 3 browser layer.
It is now working like a charm! THANK YOU SO MUCH!!!! Cheers!!!!
for the record it's also possible to do it in the theme with something like that added to rules.xml
<xsl:template match="//*[@class and contains(concat(' ', normalize-space(@class), ' '), ' pat-moment ')]/@data-pat-moment">
The date format can of course be customized by replacing the 'LLL' part (see moment.js docs)
works with Barceloneta (tested on demo.plone.de), with other themes YMMV. But it could be seen as a compatibility test with Plone 5.1 if it does not work correctly the theme is not fully compaible
Oh wow! I did not know that. Thanks so much gp54321. This is great! Cheers!