Вопрос

No matter what I do, my DatePickerDialog always displays the month, the day then the year.

Or I need to display the day, the month and then the year.

How can I do that ?

Here is my little code :

    Calendar cal = Calendar.getInstance(Locale.FRANCE);
    cal.setTime(date);
    int year = cal.get(Calendar.YEAR);
    int month = cal.get(Calendar.MONTH);
    int day = cal.get(Calendar.DAY_OF_MONTH);

    DatePickerDialog dateDialog = new DatePickerDialog(this, 2, mListenerModifierDate, year, month, day);
    dateDialog.setTitle("Modification de la date d\'intervention");
    dateDialog.setMessage("Choisissez une date égale ou inférieure à aujourd\'hui.");
Это было полезно?

Решение

Your best option is to create you own. I do not think you can modify the datepickerdialog to display it that way. Here is the source code to datePickerDialog -> source and here is the layout for datepicker which is called by datepickerdialog. Just modify your layout and the create your own datepickerdialog class and modify its constructors to use your layout instead.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top