01: /*
02:
03: This software is OSI Certified Open Source Software.
04: OSI Certified is a certification mark of the Open Source Initiative.
05:
06: The license (Mozilla version 1.0) can be read at the MMBase site.
07: See http://www.MMBase.org/license
08:
09: */
10: package org.mmbase.util;
11:
12: import java.text.DateFormatSymbols;
13: import java.util.Locale;
14:
15: /**
16: * The DateString class provides constant text strings for the weekday, month etc.
17: *
18: * @deprecated FIX dutch days
19: * @version $Id: DateStrings.java,v 1.10 2005/08/31 11:46:55 nklasens Exp $
20: */
21: public class DateStrings {
22:
23: /**
24: * Dutch short week day names
25: */
26: public static final String Dutch_days[] = { "", "zon", "maa",
27: "din", "woe", "don", "vry", "zat", "zon" };
28:
29: public static final DateStrings DUTCH_DATESTRINGS = new DateStrings(
30: "nl");
31: public static final DateStrings ENGLISH_DATESTRINGS = new DateStrings(
32: "en");
33:
34: /**
35: * Short week day names (value deoends on chosen language)
36: */
37: private String day[];
38: /**
39: * Long week day names (value deoends on chosen language)
40: */
41: private String longday[];
42: /**
43: * Long short month names (value deoends on chosen language)
44: */
45: private String month[];
46: /**
47: * Long month names (value deoends on chosen language)
48: */
49: private String longmonth[];
50:
51: /**
52: * Creates a DateString insatnce, configured for the specified language.
53: * The name of the language has to be an ISO 639 code.
54: */
55: public DateStrings(String language) {
56: Locale aLocale = new Locale(language);
57: DateFormatSymbols symbols = new DateFormatSymbols(aLocale);
58:
59: day = symbols.getShortWeekdays();
60: longday = symbols.getWeekdays();
61: month = symbols.getShortMonths();
62: longmonth = symbols.getMonths();
63:
64: if (language.equals("nl")) {
65: day = Dutch_days;
66: }
67: }
68:
69: public String getMonth(int monthInt) {
70: return longmonth[monthInt];
71: }
72:
73: public String getShortMonth(int monthInt) {
74: return month[monthInt];
75: }
76:
77: public String getDay(int weekDayInt) {
78: return longday[weekDayInt + 1];
79: }
80:
81: public String getShortDay(int weekDayInt) {
82: return day[weekDayInt + 1];
83: }
84:
85: }
|