-2

I have a Datepicker (not a DatePickerDialog) which allows customer select the day of the week. The problem is that I need display the day of the week in String format (MON, TUE, WED, THU,...), not as number. I have been searching but I couldn't find anything. Does anyone know how I can do it? Thank you very much in advance.

Stephan Branczyk
  • 9,363
  • 2
  • 33
  • 49
user2356533
  • 51
  • 1
  • 4

2 Answers2

0

Simple to use:

DateFormatSymbols symbols = new DateFormatSymbols(Locale.GERMAN);
String[] dayNames = symbols.getWeekdays();

use your number as index to this array.

good night.

Gladi
  • 415
  • 4
  • 16
  • Thank you for your answer but I don't understand it. How can I use this sentences in order to display the days in string format? – user2356533 May 07 '13 at 04:30
0

This may help you. https://stackoverflow.com/a/40863860/7973469

Use an Array like:

public static final String[] DAYS = {"Sun", "Mon", "Tues", "Wed", "Fri", "Sat"};

Then call it as DAYS[dday] :D

Community
  • 1
  • 1