public abstract class MustCalendar
extends java.util.Calendar
ALL_STYLES, AM, AM_PM, APRIL, areFieldsSet, AUGUST, DATE, DAY_OF_MONTH, DAY_OF_WEEK, DAY_OF_WEEK_IN_MONTH, DAY_OF_YEAR, DECEMBER, DST_OFFSET, ERA, FEBRUARY, FIELD_COUNT, fields, FRIDAY, HOUR, HOUR_OF_DAY, isSet, isTimeSet, JANUARY, JULY, JUNE, LONG, LONG_FORMAT, LONG_STANDALONE, MARCH, MAY, MILLISECOND, MINUTE, MONDAY, MONTH, NARROW_FORMAT, NARROW_STANDALONE, NOVEMBER, OCTOBER, PM, SATURDAY, SECOND, SEPTEMBER, SHORT, SHORT_FORMAT, SHORT_STANDALONE, SUNDAY, THURSDAY, time, TUESDAY, UNDECIMBER, WEDNESDAY, WEEK_OF_MONTH, WEEK_OF_YEAR, YEAR, ZONE_OFFSET
Constructor and Description |
---|
MustCalendar() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
getCurrentYearAsString()
Returns the current year as a string.
|
static int |
getDiffDays(java.util.Date date1,
java.util.Date date2)
Returns the difference in days between two dates.
|
static int |
getDiffYears(java.util.Date date1,
java.util.Date date2)
Returns the difference in years between two dates.
|
static java.util.Calendar |
getFutureCalendarDate(int futureDaysFromToday,
boolean[] daysOfWeekValid)
Returns a future date excluding invalid days as a calendar.
|
static java.sql.Date |
getFutureSqlDate(int futureDaysFromToday)
Returns a future date.
|
static java.sql.Date |
getFutureSqlDate(int futureDaysFromToday,
boolean[] daysOfWeekValid)
Returns a future date excluding invalid days as an SQL date.
|
static java.sql.Date |
getMonthEndDate(int year,
int month,
int date)
Returns the date representing the last day of the month as specified by the given date.
|
static int |
getMonthEndDay(java.util.Calendar anotherDayOfThisMonth)
Returns the last day of the month as specified by the given date.
|
static int |
getMonthEndDay(int year,
int month,
int date)
Returns the date representing the last day of the month as specified by the given date.
|
static java.sql.Date |
getSqlDate(java.util.Calendar calendarDate)
Returns a calendar date as an SQL date.
|
static java.lang.String |
getTodayDateAsEditableString()
Returns today as an editable string for the default locale.
|
static java.lang.String |
getTodayDateAsEditableString(java.util.Locale locale)
Returns today as an editable string.
|
static java.sql.Date |
getTodaySqlDate()
Returns the today date as an SQL date.
|
static int |
getTodaysWeekDay()
Returns the today's day of week.
|
static java.lang.String |
getYearBeginDateAsEditableString()
Returns the first day of the current year as an editable string for the
default locale.
|
static java.lang.String |
getYearBeginDateAsEditableString(java.util.Locale locale)
Returns the first day of the current year as an editable string.
|
static java.util.Date |
getYearEndDate()
Returns the last day of the current year as date value.
|
static java.lang.String |
getYearEndDateAsEditableString()
Returns the last day of the current year as an editable string for the
default locale.
|
static java.lang.String |
getYearEndDateAsEditableString(java.util.Locale locale)
Returns the last day of the current year as an editable string.
|
static boolean |
isDateFormattedDotSeparated(java.util.Locale locale) |
add, after, before, clear, clear, clone, compareTo, complete, computeFields, computeTime, equals, get, getActualMaximum, getActualMinimum, getAvailableCalendarTypes, getAvailableLocales, getCalendarType, getDisplayName, getDisplayNames, getFirstDayOfWeek, getGreatestMinimum, getInstance, getInstance, getInstance, getInstance, getLeastMaximum, getMaximum, getMinimalDaysInFirstWeek, getMinimum, getTime, getTimeInMillis, getTimeZone, getWeeksInWeekYear, getWeekYear, hashCode, internalGet, isLenient, isSet, isWeekDateSupported, roll, roll, set, set, set, set, setFirstDayOfWeek, setLenient, setMinimalDaysInFirstWeek, setTime, setTimeInMillis, setTimeZone, setWeekDate, toInstant, toString
public static java.lang.String getCurrentYearAsString()
public static java.lang.String getTodayDateAsEditableString()
public static java.lang.String getTodayDateAsEditableString(java.util.Locale locale)
locale
- the locale for formatting aspectspublic static int getTodaysWeekDay()
public static java.lang.String getYearBeginDateAsEditableString()
public static java.lang.String getYearBeginDateAsEditableString(java.util.Locale locale)
locale
- the locale for formatting aspectspublic static java.lang.String getYearEndDateAsEditableString()
public static java.lang.String getYearEndDateAsEditableString(java.util.Locale locale)
locale
- the locale for formatting aspectspublic static java.util.Date getYearEndDate()
public static boolean isDateFormattedDotSeparated(java.util.Locale locale)
public static java.sql.Date getMonthEndDate(int year, int month, int date)
year
- the regarded yearmonth
- the regarded month where 1 means Januarydate
- the day of the monthpublic static int getMonthEndDay(int year, int month, int date)
year
- the regarded yearmonth
- the regarded month where 1 means Januarydate
- the day of the monthpublic static int getMonthEndDay(java.util.Calendar anotherDayOfThisMonth)
anotherDayOfThisMonth
- another day of the regarded monthpublic static java.sql.Date getTodaySqlDate()
public static java.sql.Date getFutureSqlDate(int futureDaysFromToday)
futureDaysFromToday
- the number of days in the future beginning from todaypublic static java.sql.Date getFutureSqlDate(int futureDaysFromToday, boolean[] daysOfWeekValid)
futureDaysFromToday
- the number of days in the future beginning from todaydaysOfWeekValid
- the valid days of the weekpublic static java.util.Calendar getFutureCalendarDate(int futureDaysFromToday, boolean[] daysOfWeekValid)
futureDaysFromToday
- the number of days in the future beginning from todaydaysOfWeekValid
- the valid days of the weekpublic static java.sql.Date getSqlDate(java.util.Calendar calendarDate)
calendarDate
- the calendar date to transformpublic static int getDiffDays(java.util.Date date1, java.util.Date date2)
date1
- Date 1date2
- Date 2public static int getDiffYears(java.util.Date date1, java.util.Date date2)
date1
- Date 1date2
- Date 2Copyright 1998-2023 Christoph Mueller, Kaerntner Str. 56, D-70469 Stuttgart, Germany, https://www.perpus.de