-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