Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 3280

Format date with sap.ui.core.format.DateFormat fires "d.getTime is not a function" error

$
0
0

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.


Viewing all articles
Browse latest Browse all 3280

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>