on 10-19-2015 12:23 PM
Hi!
I know there´s a lot of threads regarding datepicker and date format, but i haven´t found a solution to my problem yet.
I need to change the format of the datepicker to dd-MM-yyyy. The datepicker is not bound to a model. Here is an example:
var oDatePicker1 = new sap.ui.commons.DatePicker('date1');
oDatePicker1.setYyyymmdd("20100101");
oDatePicker1.setLocale("de");
It outputs 01.01.2010 - how to change this to 01-01-2010?
Kind regards,
Kim
var oDatePicker1 = new DatePicker('date1');
oDatePicker1._formatValue(new Date());
oDatePicker1._oFormat = sap.ui.core.format.DateFormat.getInstance(
{pattern: "dd-MM-yyyy", strictParsing: true, calendarType: sap.ui.core.CalendarType.Gregorian});
dont like using internal variable/functions - wrap it as a custom control
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi Kim,
Chile date format is the same as the new German date format - not too sure if this is enough for your needs. Case you want to give it a try:
var oDatePicker = new DatePicker({ locale: 'es-CL' });
Hope it helps,
Dan.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Kim,
You could use JavaScript replace method. Check this sample: JS Bin - Collaborative JavaScript Debugging
Regards,
Sai Vellanki.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
9 | |
8 | |
6 | |
6 | |
6 | |
5 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.