I have a table control in linked to a backend OData service. One of the column contains the value "Start time"
which is coming from backend as PT01H15M32S
. Is there any way that I can convert this format to the legible format? Below is how I am trying to achieve it.
oTable.addColumn(new sap.ui.table.Column({
label: new sap.ui.commons.Label({text: "Start Time"}),
template: new sap.ui.commons.TextView().bindProperty("text", {
path: "STRTTIME",
type: new sap.ui.model.type.Time({
source: {
__edmtype: "Edm.Time"
},
pattern: "HH:MM:SS"
})
}),
sortProperty: "STRTTIME",
editable: false,
}));
There is also a function formatValue
for sap.ui.model.type.Time
, but I am not sure how can I use it to get the correct time format.