Quantcast
Channel: SCN : All Content - SAPUI5 Developer Center
Viewing all articles
Browse latest Browse all 6178

Date Format changes the value of the Day

$
0
0

Hi,

 

My oData service provides data in the below format:

 

<d:WiCd>2014-12-12T00:00:00</d:WiCd>


This date is formatted in my application as below:


// Set the Document Created date  var oAttrCrdttm = new sap.m.ObjectAttribute({id:"Crdttm",  visible: true,  title: "Created",  text: {path: "WiCd",    formatter: function(date){      if(date){              var oDateFormat = sap.ui.core.format.DateFormat.getDateInstance({pattern: "MM-dd-yyyy"});              date1 = oDateFormat.format(new Date(date));              return date1             }else {              return null;          } } },  active: false });

But the output shows below:

 

date.jpg

After formatting the date it changes the day by one day, not sure what could be the reason.

 

Thank you for your time and help


Viewing all articles
Browse latest Browse all 6178

Trending Articles



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