I am getting oData from backend.its data with timestamp and I need to get the difference from those timestamp.Which I did like bellow code.Now I want to add my that timestamp array to my view.Can I push those new array data to the view or how can I add update data to my sapui5 view. Bellow are the codes.xml view:
GenericTile class="cm_productTile sapUiMediumMarginTop" header="Flow" visible="{=${dataResults>/flowSelected}==='true'}"> /flow}" class="sapUiSmallMarginTop"> <core:Fragment fragmentName="castor.fua.FUAsapui5FE.fragments.flowMainNode" type="XML"/> <core:Fragment fragmentName="castor.fua.FUAsapui5FE.fragments.flowSubNode" type="XML"/>
var flowData = this.getView().getModel("elementsDataModel").oData.flow; //for (var i = 0; i < flowData.length; i++) {
console.log(flowData);
var differences = [];
for (var i = 0; i < flowData.length - 1; i++) {
var diff = new Date(flowData[i + 1].createdAt) - new Date(flowData[i].createdAt);
var diffMins = new Date(diff).getSeconds();
differences.push({diff:diffMins});
}
So differences array is the new data and I need to add those values in the view.