I am using Worklist.view.xml and receive /Date(1671944676355)/
Text text="{Exdat}"
When I try
Text text="{path: 'Exdat',
type: 'sap.ui.model.type.Date',
formatOptions:{pattern:'dd/MM/YYYY'}
}"
I receive the error message. How correctly convert date from JSON MODEL in such formate dd/MM/YYYY?
Also I receive time in such formate PT8H19M11S. I need to convert it in format hh:mm:ss?
I solved my problem:
In Worklist.view.xml I use formatter function:
Text text="{path:'Exdat', formatter: '.formatter.formatDate'}"
Then in formatter.js I write
formatDate: function (sValue) {
var date = new Date(parseInt(sValue.substr(6)));
var oFormat = sap.ui.core.format.DateFormat.getDateInstance({pattern: "dd.MM.YYYY"});
return oFormat.format(date);
},