|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.google.gwt.widgetideas.datepicker.client.CalendarModel
public class CalendarModel
Model used to get calendar information.
Field Summary | |
---|---|
static int |
DAYS_IN_WEEK
|
static int |
WEEKS_IN_MONTH
|
Constructor Summary | |
---|---|
CalendarModel()
Constructor. |
Method Summary | |
---|---|
static boolean |
computeYearBeforeMonth()
Is the year before the month? |
static java.util.Date |
copy(java.util.Date date)
Copies the given date. |
java.util.Date |
createDate(int dayOfMonth)
Create a date in the current month at the given day. |
java.lang.String |
createKeyFromDate(java.util.Date date)
Create a unique string key for the given date. |
static int |
diffDays(java.util.Date start,
java.util.Date finish)
Returns the number of days between the two dates. |
java.lang.String |
format(java.util.Date date)
Format the date using this model's formatter. |
java.lang.String |
formatCurrentMonth()
Formats the month in year. |
java.lang.String |
formatCurrentYear()
Formats the year. |
java.lang.String |
formatDayOfMonth(java.util.Date date)
Format the date's day of month. |
java.lang.String |
formatDayOfMonth(int dayOfMonth)
Formats the date's day of month. |
java.lang.String |
formatDayOfWeek(int dayInWeek)
Format the day in the week. |
int |
getCurrentMonth()
Get the current month. |
java.util.Date |
getCurrentMonthAndYear()
Gets the current month and year. |
int |
getCurrentNumberOfDaysInMonth()
Returns size of the current month. |
int |
getCurrentStartingDayOfWeek()
Gets the current starting day of week. |
int |
getCurrentYear()
Gets the current year. |
java.util.Date |
getFirstDayOfCurrentFirstWeek()
Gets the first day of the first week in the current month and year. |
static int |
getLocaleStartingDayOfWeek()
Returns the day of the week on which week starts as per the locale. |
boolean |
isInCurrentMonth(java.util.Date date)
Is the date in the current month. |
boolean |
isWeekend(int dayOfWeek)
Is the day of the week a weekend? |
java.util.Date |
parseDate(java.lang.String text)
Default formatter for date parsing. |
void |
setCurrentMonthAndYear(java.util.Date currentMonthAndYear)
Sets the current month and year |
void |
shiftCurrentMonth(int deltaMonths)
Shifts the current month by the given number of months. |
static void |
shiftDays(java.util.Date date,
int days)
Shift the date by the given number of days. |
static void |
shiftMonths(java.util.Date date,
int months)
Shift the date by the given number of months. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int WEEKS_IN_MONTH
public static final int DAYS_IN_WEEK
Constructor Detail |
---|
public CalendarModel()
Method Detail |
---|
public static boolean computeYearBeforeMonth()
public static java.util.Date copy(java.util.Date date)
date
- the date
public static int diffDays(java.util.Date start, java.util.Date finish)
start
- finish
-
public static int getLocaleStartingDayOfWeek()
public static void shiftDays(java.util.Date date, int days)
date
- the datedays
- number of dayspublic static void shiftMonths(java.util.Date date, int months)
date
- the datemonths
- number of monthspublic java.util.Date createDate(int dayOfMonth)
dayOfMonth
- the day in the month
public java.lang.String createKeyFromDate(java.util.Date date)
date
- the date
public java.lang.String format(java.util.Date date)
selectedDate
-
public java.lang.String formatCurrentMonth()
public java.lang.String formatCurrentYear()
public java.lang.String formatDayOfMonth(java.util.Date date)
date
- the date
public java.lang.String formatDayOfMonth(int dayOfMonth)
public java.lang.String formatDayOfWeek(int dayInWeek)
dayInWeek
- the day in week
public int getCurrentMonth()
public java.util.Date getCurrentMonthAndYear()
public int getCurrentNumberOfDaysInMonth()
public int getCurrentStartingDayOfWeek()
public int getCurrentYear()
public java.util.Date getFirstDayOfCurrentFirstWeek()
public boolean isInCurrentMonth(java.util.Date date)
date
- date
public boolean isWeekend(int dayOfWeek)
dayOfWeek
- day of week
public java.util.Date parseDate(java.lang.String text)
public void setCurrentMonthAndYear(java.util.Date currentMonthAndYear)
currentMonthAndYear
- the current month and yearpublic void shiftCurrentMonth(int deltaMonths)
deltaMonths
- - number of months to be added to the current date
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |