Class CalendarUtil
java.lang.Object
com.google.gwt.user.datepicker.client.CalendarUtil
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddDaysToDate(Date date, int days) Adds the given number of days to a date.static voidaddMonthsToDate(Date date, int months) Adds the given number of months to a date.static DateCopies a date.static intgetDaysBetween(Date start, Date finish) Returns the number of days between the two dates.static intReturns the day of the week on which week starts in the current locale.static booleanisSameDate(Date date0, Date date1) Check if two dates represent the same date of the same year, even if they have different times.(package private) static booleanisWeekend(int dayOfWeek) Is a day in the week a weekend?static voidResets the date to have no time modifiers.static voidsetToFirstDayOfMonth(Date date) Sets a date object to be at the beginning of the month and no time specified.
-
Constructor Details
-
CalendarUtil
public CalendarUtil()
-
-
Method Details
-
addDaysToDate
Adds the given number of days to a date.- Parameters:
date- the datedays- number of days
-
addMonthsToDate
Adds the given number of months to a date.- Parameters:
date- the datemonths- number of months
-
copyDate
-
getDaysBetween
-
getStartingDayOfWeek
public static int getStartingDayOfWeek()Returns the day of the week on which week starts in the current locale. The range between 0 for Sunday and 6 for Saturday.- Returns:
- the day of the week
-
isSameDate
-
setToFirstDayOfMonth
Sets a date object to be at the beginning of the month and no time specified.- Parameters:
date- the date
-
isWeekend
static boolean isWeekend(int dayOfWeek) Is a day in the week a weekend?- Parameters:
dayOfWeek- day of week- Returns:
- is the day of week a weekend?
-
resetTime
Resets the date to have no time modifiers. Note that the hour might not be zero if the time hits a DST transition date.- Parameters:
date- the date
-