[Plone5] Change friendly datetime format in folder_contents

Plone 5 default theme folder_contents view come with a friendly datetime format (e.g: last 3 days) instead of exact calendar time. However there is no simple setting to display normal datetime instead of friendly datetime. After couple of hours digging around, I figured out that all folder_contents view is now handled by the mockup framework and all configurations are defined in a javascript file at "/eggs/mockup-2.1.5-py2.7.egg/mockup/patterns/structure/pattern.js" . In that file there is an option called "momentFormat":"relative" which is the configuration you need to change. In order to override this you need to:

  • goto: /@@resourceregistry-controlpanel
  • tabs: "Pattern Options"
  • Add pattern with name "structure" (like the name defined in the javascript five above)
  • content of the pattern should be '{"momentFormat": "calendar"}'
  • Now clear cached, refresh folder_contents
1 Like

Thanks @cuongnda !

@svx where would this best fit in the docs?

I just fixed this bug in Plone 5.1 master a few days ago to use normal date and time in folder_contents (and fixed the pattern to use localized dates) in master of 5.1, but not in b2 release.
For content management tasks the relative annoyed any editor, so I consider this a bug.

1 Like

Does this mean it'll make it into 5.1b3?

Yes

I wonder how hard it would be for the patterns tab to show the default values or docs so as it make this kind of setting more discoverable?

Cool! I've seen this before but keep forgetting...

http://plone.github.io/mockup/dev/#pattern/moment

Filed these issues