Skip to Content
0

Not able to bind EDM.time in SAP Text field

Dec 13, 2016 at 09:38 AM

53

avatar image

I am getting time from the backend in EDM.time format. But when I bind it to my text field it gives no Data.

This is how data is coming from backend.

Erzet:Object

__edmType:"Edm.Time"

ms:19381000

And This is how I bound it in Table.

text="{path:'viewData>Erzet', type:'sap.ui.model.type.Time', formatOptions: { pattern: 'HH:mm:ss'}}"/>

But it says sap.ui.model.type.Time' is not defined. However sap.ui.model.type.Date works fine.

The problem is in the Binding can someone help with that please.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Deepak Anumula Dec 13, 2016 at 03:00 PM
0

Hi Shivansh,

Before you bind the time to the UI u need to get change the offset value :19381000

var TZOffsetMs = new Date().getTimezoneOffset()*60*1000;

I am not sure this is the correct formula,but the format is the same.There may be a little change in the formula.

This is how u can change the time and then u can bind the value to the UI element.

Hope u can achieve by using this.

If any issue please revert back.

Thanks,

Deepak.

Share
10 |10000 characters needed characters left characters exceeded
Jun Wu Dec 13, 2016 at 03:44 PM
0

check if this helps

sap.ui.model.odata.type.Time

Share
10 |10000 characters needed characters left characters exceeded