Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8653

Change Date Format

$
0
0

Hi All

The oData model returns the date value as - 2013-05-30T00:00:00

 

How do I change it to a MM-dd-yyyy format when displaying in a date picker. I tried the following formatter class

var oDatePicker1 = new sap.ui.commons.DatePicker("lossDateID",{

                                          value:{

                                                      path: "jsonModel>/EZlotReview/FirstNoticeDate", formatter: function(fValue){

                                                      jQuery.sap.require("sap.ui.core.format.DateFormat");

                    var oDateFormat = sap.ui.core.format.DateFormat.getDateTimeInstance({pattern: "MM-dd-yyyy"});

                    return oDateFormat.format(new Date(fValue));

                                                      }

 

                                          }


Viewing all articles
Browse latest Browse all 8653

Trending Articles



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