Tuesday, June 21, 2016

Changing the Default Date Format in Alfresco

Changing the Date Format in Alfresco

By default, Alfresco displays dates in the dd/mm/yyyy format, while most US users prefer to have dates shown in the mm/dd/yyyy format.  There are two files that must be edited to change the date format in Alfresco.

Open the following file for editing:
<alfresco home>\tomcat\webapps\share\WEB-INF\classes\alfresco\messages\common_en.properties
Look for any date format entries and edit them to swap the positions of the mm and dd values (change dd/mm/yyyy to mm/dd/yyyy, for example).  Search for mm to be sure you get them all (we found 12 values to change on a recent installation).  Note that “ddd” and “dddd” values represent the day of the week (Mon or Monday, respectively), and are probably already in the correct locations.

The second file controls the dates displayed in the date picker control, but this file may not exist in your environment.  See if the following file exists:
<alfresco home>\tomcat\shared\classes\alfresco\web-extension\site-webscripts\org\alfresco\components\form\form.get_en.properties
If it doesn’t exist, copy it from here (create the form folder if necessary):
<alfresco home>\tomcat\webapps\share\WEB-INF\classes\alfresco\site-webscripts\org\alfresco\components\form\form.get_en.properties
Open the form.get_en.properties file for editing.  Search for “form-control.date-picker” to find the proper properties to change (we found four values on a recent installation).

Restart Alfresco to make the changes take effect.

No comments:

Post a Comment