|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jasig.schedassist.model.CommonDateOperations
public final class CommonDateOperations
Date and Calendar operations common across this application.
| Field Summary | |
|---|---|
protected static String |
DATE_FORMAT
|
protected static String |
DATE_TIME_FORMAT
|
| Constructor Summary | |
|---|---|
CommonDateOperations()
|
|
| Method Summary | |
|---|---|
static long |
approximateDifference(Date start,
Date end)
Returns the approximate difference in DAYS between start and end. |
static Date |
beginningOfDay(Date date)
Return a new Date object that represents the beginning of the same day as the argument,
e.g. |
static Date |
calculateSundayPrior(Date date)
Returns the Sunday prior to the date argument elements of the returned array, respectively. |
static Date |
endOfDay(Date date)
Return a new Date object that represents the end of the same day as the argument,
e.g. |
static boolean |
equalsOrAfter(Date date1,
Date date2)
Returns true if the specified dates are equal OR if date1 is after date2. |
static boolean |
equalsOrBefore(Date date1,
Date date2)
Returns true if the specified dates are equal OR if date1 is before date2. |
static SimpleDateFormat |
getDateFormat()
|
static SimpleDateFormat |
getDateTimeFormat()
|
static int |
numberOfDaysUntilSunday(Date date)
Helper method to calculate the first week's end date. |
static Date |
parseDatePhrase(String datePhrase)
Convert a String in the common date format for this application into a Date. |
static Date |
parseDateTimePhrase(String timePhrase)
Convert a String in the common date/time format for this application into a Date. |
protected static Calendar |
zeroOutTimeFields(Calendar calendar)
Simple method that sets Calendar.HOUR_OF_DAY, Calendar.MINUTE, Calendar.SECOND, and Calendar.MILLISECOND to 0. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final String DATE_TIME_FORMAT
protected static final String DATE_FORMAT
| Constructor Detail |
|---|
public CommonDateOperations()
| Method Detail |
|---|
public static SimpleDateFormat getDateTimeFormat()
SimpleDateFormat that uses this application's common Date/Time format ("yyyyMMdd-HHmm").public static SimpleDateFormat getDateFormat()
SimpleDateFormat that uses this application's common Date format ("yyyyMMdd").public static Date calculateSundayPrior(Date date)
date -
public static Date parseDateTimePhrase(String timePhrase)
throws InputFormatException
String in the common date/time format for this application into a Date.
timePhrase - format: "yyyyMMdd-HHmm"
InputFormatException
public static Date parseDatePhrase(String datePhrase)
throws InputFormatException
String in the common date format for this application into a Date.
datePhrase - format: "yyyyMMdd"
InputFormatException
public static boolean equalsOrAfter(Date date1,
Date date2)
date1 - date2 -
DateUtils.isSameInstant(Date, Date),
Date.after(Date)
public static boolean equalsOrBefore(Date date1,
Date date2)
date1 - date2 -
DateUtils.isSameInstant(Date, Date),
Date.before(Date)
public static long approximateDifference(Date start,
Date end)
start - end -
public static int numberOfDaysUntilSunday(Date date)
date -
protected static Calendar zeroOutTimeFields(Calendar calendar)
calendar -
public static Date beginningOfDay(Date date)
Date object that represents the beginning of the same day as the argument,
e.g. 00:00:00.000
date -
Date object that represents the beginning of the same day as the argumentpublic static Date endOfDay(Date date)
Date object that represents the end of the same day as the argument,
e.g. 23:59:59.999
date -
Date object that represents the end of the same day as the argument
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||