SAPUI5 Date and Time format from ABAP ODATA

Just to have it clarified and put together in one place.

Underneath you’ll find a Date & Time formatting for XML view from standard ABAP DATE and TIME format.

<Label text="{i18n>DateFromAbap}" />
<Text text="{
		path: 'DateFromABAP',
		type: 'sap.ui.model.type.Date',
		formatOptions: {
		pattern: 'dd.MM.YYYY'
		}
	}"
/>
<Label text="{i18n>TimeFromAbap}" />
<Text text="{
		path: 'TimeFromABAP/ms',
		type: 'sap.ui.model.type.Time',
		formatOptions: {
		source : { pattern : 'timestamp' },
		pattern: 'HH:mm:ss'
	} }"
 />

As you presume “DateFromABAP” and “TimeFromABAP” are taken from OData binded variables.

Published by

Captain SAP

Captain SAP is a technical consultant with over 15 yeras of expierience in integrated systems implementation.

One thought on “SAPUI5 Date and Time format from ABAP ODATA

Leave a Reply

Your email address will not be published. Required fields are marked *