|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.calendartag.util.CalendarTagUtil
Constructor Summary | |
CalendarTagUtil()
|
Method Summary | |
static int |
dayCompare(java.util.Calendar leftCalendar,
java.util.Calendar rightCalendar)
Determines if the leftCalendar is before, during or after the rightCalendar based on the year, month, and day of the date only. |
static int |
differenceInDays(java.util.Calendar a,
java.util.Calendar b)
Accurately calculates the difference between two calendars in days. |
static boolean |
isSameDay(java.util.Calendar a,
java.util.Calendar b)
Determines if two Calendar objects are the same day, month and year. |
static void |
trimCalendar(java.util.Calendar calendar)
Removes the milliseconds, minutes, seconds, and hours from a Calendar object |
static void |
trimDate(java.util.Date date)
Uses trimCalendar to remove milliseconds, minutes, seconds, and hours from a Date object |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public CalendarTagUtil()
Method Detail |
public static void trimCalendar(java.util.Calendar calendar)
Calendar
object
calendar
- the Calendar
objectpublic static void trimDate(java.util.Date date)
trimCalendar
to remove milliseconds, minutes, seconds, and hours from a Date
object
date
- The Date
objectpublic static boolean isSameDay(java.util.Calendar a, java.util.Calendar b)
Calendar
objects are the same day, month and year.
a
- the first Calendar
objectb
- the second Calendar
object
public static int dayCompare(java.util.Calendar leftCalendar, java.util.Calendar rightCalendar)
Date.before(Date)
since it only compares based on
the day and is capable of returning 0 when the day is the same
leftCalendar
- the left calendarrightCalendar
- the right calendar
public static int differenceInDays(java.util.Calendar a, java.util.Calendar b)
a
- the first calendarb
- the second calendar
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |