net.sf.nachocalendar.components
Class CalendarUtils

java.lang.Object
  extended by net.sf.nachocalendar.components.CalendarUtils

public final class CalendarUtils
extends java.lang.Object

Collection of utilities.

Author:
Ignacio Merani

Method Summary
static java.util.Date convertToDate(java.lang.Object o)
          Converts Object to Date.
static java.lang.String getMessage(java.lang.String key)
          Returns a localized message.
static boolean isSameDay(java.util.Date d1, java.util.Date d2)
          Compares two dates.
static boolean isToday(java.util.Date date)
          Compares provided date with the current Date.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

convertToDate

public static java.util.Date convertToDate(java.lang.Object o)
                                    throws java.text.ParseException
Converts Object to Date.

Parameters:
o - Object to convert
Returns:
a Date
Throws:
java.text.ParseException - if something goes wrong

isSameDay

public static boolean isSameDay(java.util.Date d1,
                                java.util.Date d2)
Compares two dates.

Parameters:
d1 - first date
d2 - second date
Returns:
true if both dates are the same day

isToday

public static boolean isToday(java.util.Date date)
Compares provided date with the current Date.

Parameters:
date - date to compare
Returns:
true if is current day

getMessage

public static java.lang.String getMessage(java.lang.String key)
Returns a localized message.

Parameters:
key - message key
Returns: