Can someone tell me what would be involved to change a data list input formatting of a date/time from 24 hour military format to a 12 hour AM/PM format when creating and editing a datalist date/time item.
Thank You.
The date/time formats are configured at form level irrespective of data list form or any other form you configure.
You can do it by extending the form properties. You can find OOTB form.get.properties under "<alfresco_installation_home>\tomcat\webapps\share\WEB-INF\classes\alfresco\site-webscripts\org\alfresco\components\form\form.get.properties" or check the source code here for taking the reference of all the properties.
You can try changing the properties related to time format and see if it works for you. I have not tried it though. However, i had extended date format specific properties to change the date format as i can recall and it worked.
These are the properties you would be looking to try and change:
## Format used for time entry in datetime picker, 'entry' format is used by date parsing code, ## 'display' format is shown to the user under time entry field form.control.date-picker.entry.time.format=HH:mm form.control.date-picker.display.time.format=HH:MM (24 Hour) ## Format used for date and time when form is in 'view' mode form.control.date-picker.view.date.format=EEE dd MMM yyyy form.control.date-picker.view.time.format=EEE dd MMM yyyy HH:mm:ss z
Here hh for 12 hour format and HH for 24 hour format.
Note that, this extension will change the time format across share, i.e. any property with dateTime data type on forms will display time format configured above. It is not specific to only data list.
Thank you for your suggestion. While that may change the internal formatting, the input screens are still prompting the user to use military time and there is not way to select AM or PM when inputting the time.
The highlighted part is a label in the properties file.
May be a hint, if you are looking for something like user should select AM/PM from the from, then you would have to develop a custom form template to show AM/PM marker which user can select and while saving the form you will have to handle it in repo layer form.post webscript;
You need to also consider making customization to the view form to show am/pm marker.
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.