on 11-22-2013 3:11 PM
Dear All,
I am receiving Time data from SAP in EDM.Time which is not converting in SAPUI5.
Could you please help me.
Thanks,
VKK.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Kiran,
Please look at the blog Working with OData Dates and Times from John Patterson on SCN.
He explain very well how you must use date/time from OData into SAPUI5 applications.
With regards,
Robert Eijpe
initiator of sapui5.org
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Kiran,
It is mentioned in the blog Robert mentioned.
Copying from the blog,
In the below statement, select from the pattern elements mentioned in the blog.
var timeFormat = sap.ui.core.format.DateFormat.getTimeInstance({pattern: "KK:mm:ss a"});
var timeStr = timeFormat.format(new Date(DepartureTime.ms + TZOffsetMs)); //11:00 AM
var parsedTime = new Date(timeFormat.parse(timeStr).getTime() - TZOffsetMs); //39600000
Let us know if you are looking for something else?
Thanks
Krishna
Hi Krishna,
I think what Kiran wants is direct type binding for time object. Is there any way to do that directly without formatter functions.
For example :
If I make the type as Date for ZzpstartDat, the formatting is automatically taken care of but maintaining a type for time like sap.ui.model.type.Time doesn't work.
<Text text="{path : 'ZzpstartDat', type : 'sap.ui.model.type.Date'}" />
<Text text="{path : 'ZzpstartTime', formatter : '.timeFormatter'}" />
//This doesn't work::
<Text text="{path : 'ZzpstartTime', formatter : '.sap.ui.model.type.Time'}" />
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.