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

How to set Date format to dd/mm/yyyy in Datepicker.

$
0
0

Hi ,  Am using a Date picker , and want date in "dd/mm/yyyy" format .

 

I have 4 tabstrips .The Datepicker is in Tab page 1 , when i navigates to  Tab page 2 and come back to Tab page 1 the Date picker becomes blank.

 

I tried using the below code  .

 

 

// create model
var oModel = new sap.ui.model.json.JSONModel();
oModel.setData({
 dateValue: new Date(1330470000000)
});
sap.ui.getCore().setModel(oModel);

// create DatePickers and bind to model
(new sap.ui.commons.DatePicker("date2",{
 width: "10em",
 value: {
 path: "/dateValue",
 type: new sap.ui.model.type.Date({pattern: "yy-MM-dd"})
}
})).placeAt("sample2");

 

 

Thanks ,

Aisurya.


Viewing all articles
Browse latest Browse all 6178

Trending Articles



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