- Author
- Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g
Definition at line 30 of file CalendarUtil.java.
◆ getDayNames() [1/2]
static String [] org.turro.html.calendar.CalendarUtil.getDayNames |
( |
Locale |
locale | ) |
|
|
static |
◆ getDayNames() [2/2]
static String [] org.turro.html.calendar.CalendarUtil.getDayNames |
( |
Locale |
locale, |
|
|
boolean |
small |
|
) |
| |
|
static |
Definition at line 47 of file CalendarUtil.java.
48 Calendar date = Calendar.getInstance(locale);
49 SimpleDateFormat fmtDayWeek =
new SimpleDateFormat((small ?
"EE" :
"EEEE"), locale);
50 int curr = date.getFirstDayOfWeek(), idx = 0;
51 date.set(Calendar.DAY_OF_WEEK, curr);
52 List dayNames =
new ArrayList();
54 dayNames.add(fmtDayWeek.format(date.getTime()));
57 if(curr > 7) curr = 1;
58 date.set(Calendar.DAY_OF_WEEK, curr);
60 return (String[])dayNames.toArray(
new String[0]);
◆ getMonthNames() [1/2]
static String [] org.turro.html.calendar.CalendarUtil.getMonthNames |
( |
Locale |
locale | ) |
|
|
static |
◆ getMonthNames() [2/2]
static String [] org.turro.html.calendar.CalendarUtil.getMonthNames |
( |
Locale |
locale, |
|
|
boolean |
small |
|
) |
| |
|
static |
Definition at line 67 of file CalendarUtil.java.
68 Calendar date = Calendar.getInstance(locale);
69 SimpleDateFormat fmtMonth =
new SimpleDateFormat((small ?
"MMM" :
"MMMM"), locale);
70 List monthNames =
new ArrayList();
71 for(
int m = 0; m < 12; m++) {
72 date.set(Calendar.MONTH, m);
73 monthNames.add(fmtMonth.format(date.getTime()));
75 return (String[])monthNames.toArray(
new String[0]);
◆ positionFirstCell()
static void org.turro.html.calendar.CalendarUtil.positionFirstCell |
( |
Calendar |
date | ) |
|
|
static |
Definition at line 36 of file CalendarUtil.java.
37 date.set(Calendar.DAY_OF_MONTH, 1);
38 int first = date.getFirstDayOfWeek();
39 while(date.get(Calendar.DAY_OF_WEEK) != first)
40 date.add(Calendar.DAY_OF_MONTH, -1);
The documentation for this class was generated from the following file: