Show time only of datetime field in edit form of external list
-
10-12-2019 - |
Question
I have an external list containing a datetime column called "Opening". I would like to show only the time portion of this column in all views (list, edit etc.). I know how to do this in the list view, by use of the "edit formula" in sharepoint designer (design view). Is this also possible in the one-item-views? There seems to be no "edit formula" available here.
I tried to change the form field to datetimefield as follows:
<SharePoint:DateTimeField TimeOnly="True" Grid.Column="1" Grid.Row="7" ControlMode="Display" FieldName="Opening" IncludeDescription="True"></SharePoint:DateTimeField>
but despite of TimeOnly="true", the date portion is still shown. Is customizing of the forms possible?
Solution 2
It is possible by manipulating the xpath expression of the fields and using javascript as shown in this article.
OTHER TIPS
Customizing the form is one aspect - that happens in the list already (unless you do provision your Forms with your solution), but I believe you are looking at doing it declaratively. There is no way as exposed to do it declaratively as only Date is supported, but you could opt for creating a calculated column that uses any of the formulas as exposed here http://abstractspaces.wordpress.com/2009/05/02/common-date-time-formulas-for-sharepoint-calculated-fields/ - the downside is that it is Read-Only.
My take: If you want to "Edit" it either go for customizing the Edit forms or programatically go for a Custom field.