-2
我有一个表格控件链接到后端OData服务。其中一列包含起始时间值,后者来自后端PT01H15M32S(xsd格式)。有什么办法可以将这种XSD格式转换为清晰的HH:MM:SS格式。以下是我如何努力实现它。EDM的表格列格式化。时间
oTable.addColumn(new sap.ui.table.Column({
label: new sap.ui.commons.Label({text: "Start Time"}),
//template: new sap.ui.commons.TextView ({text : "{STRTTIME}"}),
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,
}));
还有一个功能formatValue新sap.ui.model.type.Time,但我不知道我怎么可以用它来获得正确的时间格式。
感谢您突出显示不正确的类型。我对此很新,我无法正确使用类型:new sap.ui.model.type.Time.formatValue。 – Manpreet