03-13-2019 09:30 PM
We are customizing our email template activities-email.ftl. The date of the activity is currently displayed using the following freemarker statement:
${activity.postDate?datetime?string.medium}
However, since many of our users are in different timezones we would like to display the date in a relative format, e.g "2 days ago", "3 hours ago", "1 week ago" etc.
We notice that activities displayed on the Alfresco Share activities dashlet are already displayed like this.
Does anyone know if there is an existing function that we can use to do this or do we have to create our own freemarker function in the template?
03-14-2019 01:37 PM
You have to build it by yourself, as it's not supported by FreeMarker out-of-the-box:
Built-ins for date/time/date-time values - Apache FreeMarker Manual
03-14-2019 01:42 PM
Alfresco is using a YUI JavaScript function to provide this feature:
Explore our Alfresco products with the links below. Use labels to filter content by product module.