Hi,
I am trying to format a date wihch I receive from an OData service. For example; the date I receive from OData service is "2016-01-22T00:00:00" . I am trying to format it to "dd MMM yyyy" pattern. Here is the code from controller:
var tempDate = this.getSelectedItemInDetayTbl("ZhataTrh") // "2016-01-22T00:00:00" var dateFormat = sap.ui.core.format.DateFormat.getDateTimeInstance({ pattern : "dd MMM yyyy", source : { pattern : "yyyy-MM-ddThh:mm:ss" } }); var tempDefDate = dateFormat.format(tempDate); //d.getTime is not a function
I can do it in XML view side. I did it before by using this pattern and source. But this time I have to do it in controller side. So please don't give me examples about view sides.