1 10 package org.mmbase.util; 11 12 import java.text.DateFormatSymbols ; 13 import java.util.Locale ; 14 15 21 public class DateStrings { 22 23 26 public static final String Dutch_days[]={"", "zon","maa","din","woe","don","vry","zat","zon" }; 27 28 public static final DateStrings DUTCH_DATESTRINGS = new DateStrings("nl"); 29 public static final DateStrings ENGLISH_DATESTRINGS = new DateStrings("en"); 30 31 34 private String day[]; 35 38 private String longday[]; 39 42 private String month[]; 43 46 private String longmonth[]; 47 48 52 public DateStrings(String language) { 53 Locale aLocale = new Locale (language); 54 DateFormatSymbols symbols = new DateFormatSymbols (aLocale); 55 56 day = symbols.getShortWeekdays(); 57 longday = symbols.getWeekdays(); 58 month = symbols.getShortMonths(); 59 longmonth = symbols.getMonths(); 60 61 if (language.equals("nl")) { 62 day=Dutch_days; 63 } 64 } 65 66 public String getMonth(int monthInt) { 67 return longmonth[monthInt]; 68 } 69 70 public String getShortMonth(int monthInt) { 71 return month[monthInt]; 72 } 73 74 public String getDay(int weekDayInt) { 75 return longday[weekDayInt + 1]; 76 } 77 78 public String getShortDay(int weekDayInt) { 79 return day[weekDayInt + 1]; 80 } 81 82 } | Popular Tags |