|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.logikdev.jsftools.StaticDateTool com.logikdev.jsftools.StaticComparisonDateTool
public class StaticComparisonDateTool
Tool for comparing Date
and Calendar
values in JSF.
This is a subclass of StaticDateTool and thus provides all the functionality of that tool
and augments it with the ability to find the relationship between any date and the current date, or between any two dates.
This comparison can result in either a textual representation of the relationship (e.g. "3 weeks, 2 days ago", "tomorrow",
or "3 hrs away") or the value of a specific time unit may be requested.
When using the textual representations, you can configure the tool to use alternate resource bundles and to skip over units
you do not want to be included.
Constructor Summary | |
---|---|
StaticComparisonDateTool()
|
Method Summary | |
---|---|
static org.apache.velocity.tools.generic.ComparisonDateTool.Comparison |
difference(java.lang.Object now,
java.lang.Object then)
Returns a ComparisonDateTool.Comparison between the result of the second specified date and the first specified date. |
static long |
toDays(long ms)
Returns the number of whole Days in the specified number of milliseconds. |
static long |
toHours(long ms)
Returns the number of whole Hours in the specified number of milliseconds. |
static long |
toMinutes(long ms)
Returns the number of whole Minutes in the specified number of milliseconds. |
static long |
toMonths(long ms)
Returns the number of whole Months in the specified number of milliseconds. |
static long |
toSeconds(long ms)
Returns the number of whole Seconds in the specified number of milliseconds. |
static long |
toWeeks(long ms)
Returns the number of whole Weeks in the specified number of milliseconds. |
static long |
toYears(long ms)
Returns the number of whole Years in the specified number of milliseconds. |
static org.apache.velocity.tools.generic.ComparisonDateTool.Comparison |
whenIs(java.lang.Object then)
Returns a ComparisonDateTool.Comparison between the result of DateTool.getCalendar() and the specified date. |
static org.apache.velocity.tools.generic.ComparisonDateTool.Comparison |
whenIs(java.lang.Object now,
java.lang.Object then)
Returns a ComparisonDateTool.Comparison between the second specified date and the first specified date. |
Methods inherited from class com.logikdev.jsftools.StaticDateTool |
---|
format, format, format, format, format, format, format, get, get, getCalendar, getDate, getDateFormat, getDateFormat, getDay, getDay, getMonth, getMonth, getSystemCalendar, getSystemDate, getSystemTime, getTimeZone, getValue, getValue, getValue, getYear, getYear, toCalendar, toCalendar, toDate, toDate, toDate, toDate |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public StaticComparisonDateTool()
Method Detail |
---|
public static final org.apache.velocity.tools.generic.ComparisonDateTool.Comparison difference(java.lang.Object now, java.lang.Object then)
ComparisonDateTool.Comparison
between the result of the second specified date and the first specified date.
now
- The date to use as representative of "now"then
- The secondary date
ComparisonDateTool.Comparison
between the result of the second specified date and the first specified datepublic static final long toDays(long ms)
ms
- The specified number of milliseconds
public static final long toHours(long ms)
ms
- The specified number of milliseconds
public static final long toMinutes(long ms)
ms
- The specified number of milliseconds
public static final long toMonths(long ms)
ms
- The specified number of milliseconds
public static final long toSeconds(long ms)
ms
- The specified number of milliseconds
public static final long toWeeks(long ms)
ms
- The specified number of milliseconds
public static final long toYears(long ms)
ms
- The specified number of milliseconds
public static final org.apache.velocity.tools.generic.ComparisonDateTool.Comparison whenIs(java.lang.Object then)
ComparisonDateTool.Comparison
between the result of DateTool.getCalendar()
and the specified date.
then
- The date in question
ComparisonDateTool.Comparison
between the result of DateTool.getCalendar()
and the specified datepublic static final org.apache.velocity.tools.generic.ComparisonDateTool.Comparison whenIs(java.lang.Object now, java.lang.Object then)
ComparisonDateTool.Comparison
between the second specified date and the first specified date.
now
- The date to use as representative of "now"then
- The date in question
ComparisonDateTool.Comparison
between the second specified date and the first specified date
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |