edu.wisc.ssec.mcidasv.data.dateChooser
Class DateUtil

java.lang.Object
  extended by edu.wisc.ssec.mcidasv.data.dateChooser.DateUtil

public class DateUtil
extends Object

A utility class for some date operations.

Version:
$LastChangedRevision: 95 $, $LastChangedDate: 2006-05-05 18:43:15 +0200 (Fr, 05 Mai 2006) $
Author:
Kai Toedter

Field Summary
protected  Date defaultMaxSelectableDate
           
protected  Date defaultMinSelectableDate
           
protected  Date maxSelectableDate
           
protected  Date minSelectableDate
           
 
Constructor Summary
DateUtil()
           
 
Method Summary
 boolean checkDate(Date date)
          Checks a given date if it is in the formally specified date range.
 Date getMaxSelectableDate()
          Gets the maximum selectable date.
 Date getMinSelectableDate()
          Gets the minimum selectable date.
 Date setMaxSelectableDate(Date max)
          Sets the maximum selectable date.
 Date setMinSelectableDate(Date min)
          Sets the minimum selectable date.
 void setSelectableDateRange(Date min, Date max)
          Sets a valid date range for selectable dates.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

minSelectableDate

protected Date minSelectableDate

maxSelectableDate

protected Date maxSelectableDate

defaultMinSelectableDate

protected Date defaultMinSelectableDate

defaultMaxSelectableDate

protected Date defaultMaxSelectableDate
Constructor Detail

DateUtil

public DateUtil()
Method Detail

setSelectableDateRange

public void setSelectableDateRange(Date min,
                                   Date max)
Sets a valid date range for selectable dates. If max is before min, the default range with no limitation is set.

Parameters:
min - the minimum selectable date or null (then the minimum date is set to 01\01\0001)
max - the maximum selectable date or null (then the maximum date is set to 01\01\9999)

setMaxSelectableDate

public Date setMaxSelectableDate(Date max)
Sets the maximum selectable date. If null, the date 01\01\9999 will be set instead.

Parameters:
max - the maximum selectable date
Returns:
the maximum selectable date

setMinSelectableDate

public Date setMinSelectableDate(Date min)
Sets the minimum selectable date. If null, the date 01\01\0001 will be set instead.

Parameters:
min - the minimum selectable date
Returns:
the minimum selectable date

getMaxSelectableDate

public Date getMaxSelectableDate()
Gets the maximum selectable date.

Returns:
the maximum selectable date

getMinSelectableDate

public Date getMinSelectableDate()
Gets the minimum selectable date.

Returns:
the minimum selectable date

checkDate

public boolean checkDate(Date date)
Checks a given date if it is in the formally specified date range.

Parameters:
date - the date to check
Returns:
true, if the date is within minSelectableDate and maxSelectableDate