on 07-25-2018 12:30 PM
Hi Everyone,
I am working on Custom SAPUI5 App development. In our application we need to display the date in the Table. It is coming in a Edm.DateTime format from OData Service.
By referring the SAPUI5 Explored Website i used format options to do formatting. But it is not getting reflected in the SAPUI5 Table.
I used like this in my sapui5 table code
<Text text="{ path: '/Erdat', type: 'sap.ui.model.type.DateTime', formatOptions: { style: 'short' } }"/> //SAPUI5 table Code
But if i use simply as Erdate without specify the formatting options , it displays the value like this
Fri Mar 07 2003 05:30:00 GMT+0530 (India Standard Time)//without Format
<d:Erdat>2003-03-07T00:00:00</d:Erdat>// in gateway Client
Type="Edm.DateTime" // type in metadata
Please refer the below image for more info:
Please help me to solve this.
Thank you,
Regards,
JK.
Hi,
Use below code to format date.
<Text text="{ path: 'main>CreatedAt', type: 'sap.ui.model.type.Date', formatOptions: { pattern: 'dd:MM:yyyy', UTC: true } }"/>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.