Hi Experts,
I am working on a custom SAPUI5 app where I need to display data in a table. I am using sap.ui.table to display the data. In the table, one of the column is a data field and to display the data for that field, I am formatting the data to display in the required format. I am using following code to format the date:
for (var index = 0; index < aHistoryData.length; index++) { aHistoryData[index].Matter_Open_Date = sap.ui.core.format.DateFormat.getDateTimeInstance({ pattern: "MM/dd/YYYY", UTC: true }).format(new Date(aHistoryData[index].Matter_Open_Date)); }
Using this code, I am facing a peculiar issue: the oData service is returning the date equivalent to 12/26/2020 but when it get formatted and gets rendered on screen, the year gets incremented by 1 i.e. the date gets displayed as 12/26/2021. I am not sure how that is happening.
Can anyone suggest how to resolve this issue.
Regards,
Arjun