Skip to Content
avatar image
Former Member

Not able to bind EDM.time in SAP Text field

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.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Dec 13, 2016 at 03:00 PM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • Dec 13, 2016 at 03:44 PM

    check if this helps

    sap.ui.model.odata.type.Time

    Add comment
    10|10000 characters needed characters exceeded