on 09-16-2014 2:54 PM
Hi All,
I am facing one critical issue to convert time format which is coming from SAP Odata model. I am able to format the value with the below code if I give static value
var DepartureTime = {__edmType: "Edm.Time", ms: 39600000};
var timeFormat = sap.ui.core.format.DateFormat.getTimeInstance({pattern: "kk:mm"});
var TZOffsetMs = new Date(0).getTimezoneOffset()*60*1000;
var timeStr = timeFormat.format(new Date(DepartureTime.ms + TZOffsetMs));
var parsedTime = new Date(timeFormat.parse(timeStr).getTime() - TZOffsetMs);
console.log('Time = ' +timeStr);
I am unable to get that value from odata to convert into Time format. I am getting the value as [object Object]. Here is the screen shot of values I am getting from SAP Odata model. Can you please helo how we can retrieve the value from "DepartureTime"
Regards,
Suresh
Message was edited by: Michael Appleby (typos)
Hi Suresh,
just put your logic in a formatter function. This formatter can then be used with the property binding. You can find the details in OpenUI5 SDK - Demo Kit. For a more complete description you can check http://scn.sap.com/community/developer-center/front-end/blog/2013/04/28/working-with-odata-dates.
Regards, Frank
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.