14 Mayıs 2010 Cuma

Locale göre ayları getirmek :)

.
.
.

Ay isimlerini tek tek message bundle'lara yazmak yerine şu şekilde bir kod buldum :)

programda hangi dil seçilirse o dil'e göre getirmekte ay isimlerini



int month = 4;
int year = 2010;

//Get Month's Names by locale :)
// Locale locale =Locale.getDefault();
Locale selectedLanguage = (Locale) Component.getInstance("org.jboss.seam.core.locale");
DateFormatSymbols symbols = new DateFormatSymbols(selectedLanguage);
String[] months = symbols.getMonths();

String monthN = months[month - 1];
allJrxmlParams.put("bordroAyYil", monthN + " / " + year);
.
.

Hiç yorum yok:

Yorum Gönder