Showing dates in folder_contents in absolute format instead of relative

I have a client who does not like the "2 months ago" date format in folder_contents, and wants the old absolute format (e.g. "2016/01/20") back.

In https://github.com/plone/mockup/blob/master/mockup/patterns/structure/pattern.js#L106, I see this:

momentFormat: 'relative',

How would I go about replacing the value for momentFormat in the structure pattern?
Thanks

1 Like

Something like this should work(untested):

  • go to site setup -> resource registries
  • click pattern options tab
  • add "structure" with the value something like this: {"momentFormat": "-your format-"}
2 Likes

It totally does! Thank you!

This is the format I used to imitate the Plone 4 format (YMMV): {"momentFormat": "MMM DD, YYYY HH:MM A"}

I will document this next week in Sorrento.

1 Like

I think fuzzy dates work most of the time for anonymous users but not for logged in users doing some site editing.

this should be the default in folder contents, but probably not for portlets/tiles, specially for dates around one week before and after the current date, IMO.

Thanks @vangheem and @fulv! According to https://github.com/plone/mockup/commit/72a3baedb80f51cccd1d1de238e9682ba3e38bdc you may want to use 'LLL' to localize the date.