0

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.");
Lynal
  • 97
  • 1
  • 1
  • 6

1 Answers1

0

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.

ObieMD5
  • 2,684
  • 1
  • 16
  • 26
  • Thanks ! That's strange, I've seen many examples where the day was first, with a code like mine. Anyway, I'm going to try your way ;) – Lynal Jul 16 '13 at 07:37
  • @Lynal I would politely ask, if I resolved your problem correctly that you mark the answer as correct so others can see what solved the problem. Thank you again – ObieMD5 Jul 21 '13 at 03:07
  • Ah yes sorry ! I only tried to click on "This anwser was useful" and said that I don't have enough reputation, So i didn't try the mark :p – Lynal Jul 22 '13 at 07:40