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?
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
Alfresco is using a YUI JavaScript function to provide this feature:
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.