public class CalendarModel
extends java.lang.Object
DatePicker
and its
subclasses.Modifier and Type | Field and Description |
---|---|
static int |
DAYS_IN_WEEK
Number of days normally displayed in a week.
|
static int |
MONTHS_IN_YEAR |
static int |
WEEKS_IN_MONTH
The number of weeks normally displayed in a month.
|
Constructor and Description |
---|
CalendarModel()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
formatCurrentMonth()
Formats the current specified month.
|
java.lang.String |
formatCurrentMonthAndYear()
Format the current month and year in the current locale.
|
java.lang.String |
formatCurrentYear()
Formats the current specified year.
|
java.lang.String |
formatDayOfMonth(java.util.Date date)
Formats a date's day of month.
|
java.lang.String |
formatDayOfWeek(int dayInWeek)
Format a day in the week.
|
java.lang.String |
formatMonth(int month)
Format a month in the year.
|
java.util.Date |
getCurrentFirstDayOfFirstWeek()
Gets the first day of the first week in the currently specified month.
|
java.util.Date |
getCurrentMonth()
Gets the date representation of the currently specified month.
|
protected DateTimeFormat |
getDayOfMonthFormatter()
Gets the date of month formatter.
|
protected DateTimeFormat |
getDayOfWeekFormatter()
Gets the day of week formatter.
|
protected DateTimeFormat |
getMonthAndYearFormatter()
Gets the month and year formatter.
|
protected DateTimeFormat |
getMonthFormatter()
Gets the month formatter.
|
protected DateTimeFormat |
getYearFormatter()
Gets the year formatter.
|
boolean |
isInCurrentMonth(java.util.Date date)
Is a date in the currently specified month?
|
protected boolean |
isMonthBeforeYear()
Returns
true if the month is before year in the date formatter in current locale. |
protected void |
refresh()
Refresh the current model as needed.
|
void |
setCurrentMonth(java.util.Date currentDate)
Sets the currently specified date.
|
void |
shiftCurrentMonth(int deltaMonths)
Shifts the currently specified date by the given number of months.
|
public static final int WEEKS_IN_MONTH
public static final int DAYS_IN_WEEK
public static final int MONTHS_IN_YEAR
public java.lang.String formatCurrentMonth()
public java.lang.String formatCurrentMonthAndYear()
public java.lang.String formatCurrentYear()
public java.lang.String formatDayOfMonth(java.util.Date date)
date
- the datepublic java.lang.String formatDayOfWeek(int dayInWeek)
dayInWeek
- the day in week to formatpublic java.lang.String formatMonth(int month)
month
- A number from 0 (for January) to 11 (for December) identifying the month wanted.public java.util.Date getCurrentFirstDayOfFirstWeek()
public java.util.Date getCurrentMonth()
public boolean isInCurrentMonth(java.util.Date date)
date
- the datepublic void setCurrentMonth(java.util.Date currentDate)
currentDate
- the currently specified datepublic void shiftCurrentMonth(int deltaMonths)
deltaMonths
- - number of months to be added to the current dateprotected DateTimeFormat getDayOfMonthFormatter()
protected DateTimeFormat getDayOfWeekFormatter()
protected DateTimeFormat getMonthAndYearFormatter()
protected DateTimeFormat getMonthFormatter()
protected DateTimeFormat getYearFormatter()
protected boolean isMonthBeforeYear()
true
if the month is before year in the date formatter in current locale.protected void refresh()