我有一个类似的问题 here或here 。我也在使用 XML View 。使用此代码
<Text text="{ path: 'model1>CHANGE_DATE' }" />
我从 OData (V2) 服务收到以下响应:
/Date(1671944676355)/
当我尝试时
<Text text="{
path: 'model1>CHANGE_DATE',
type: 'sap.ui.model.type.Date',
formatOptions: { pattern: 'MM/dd/yyyy' }
}"/>
我收到错误消息:
sap-ui-core-dbg.js:30928 Uncaught TypeError: oDate.getTime is not a function
您知道为什么格式化不起作用吗?
最佳答案
转换为 ODataModel 解决了这个问题。
关于date - 在 UI5 中格式化 "/Date(timestamp)/"值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39099365/