/lib/docs/api/com/toedter/calendar/DateUtil.html
HTML | 465 lines | 388 code | 53 blank | 24 comment | 0 complexity | 1ae3d37887d8c4c11ff55dbec6e8f8f3 MD5 | raw file
Possible License(s): LGPL-3.0, Apache-2.0, GPL-3.0, GPL-2.0, AGPL-3.0, JSON, BSD-3-Clause
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
- <!--NewPage-->
- <HTML>
- <HEAD>
- <!-- Generated by javadoc (build 1.5.0_06) on Sun Jun 04 15:41:05 CEST 2006 -->
- <TITLE>
- DateUtil (JCalendar API)
- </TITLE>
-
- <META NAME="keywords" CONTENT="com.toedter.calendar.DateUtil class">
-
- <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
-
- <SCRIPT type="text/javascript">
- function windowTitle()
- {
- parent.document.title="DateUtil (JCalendar API)";
- }
- </SCRIPT>
- <NOSCRIPT>
- </NOSCRIPT>
-
- </HEAD>
-
- <BODY BGCOLOR="white" onload="windowTitle();">
-
-
- <!-- ========= START OF TOP NAVBAR ======= -->
- <A NAME="navbar_top"><!-- --></A>
- <A HREF="#skip-navbar_top" title="Skip navigation links"></A>
- <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
- <TR>
- <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
- <A NAME="navbar_top_firstrow"><!-- --></A>
- <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
- <TR ALIGN="center" VALIGN="top">
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
- <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
- </TR>
- </TABLE>
- </TD>
- <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
- </EM>
- </TD>
- </TR>
-
- <TR>
- <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
- PREV CLASS
- <A HREF="../../../com/toedter/calendar/IDateEditor.html" title="interface in com.toedter.calendar"><B>NEXT CLASS</B></A></FONT></TD>
- <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
- <A HREF="../../../index.html?com/toedter/calendar/DateUtil.html" target="_top"><B>FRAMES</B></A>
- <A HREF="DateUtil.html" target="_top"><B>NO FRAMES</B></A>
- <SCRIPT type="text/javascript">
- <!--
- if(window==top) {
- document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>');
- }
- //-->
- </SCRIPT>
- <NOSCRIPT>
- <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>
- </NOSCRIPT>
-
-
- </FONT></TD>
- </TR>
- <TR>
- <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
- SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
- <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
- DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
- </TR>
- </TABLE>
- <A NAME="skip-navbar_top"></A>
- <!-- ========= END OF TOP NAVBAR ========= -->
-
- <HR>
- <!-- ======== START OF CLASS DATA ======== -->
- <H2>
- <FONT SIZE="-1">
- com.toedter.calendar</FONT>
- <BR>
- Class DateUtil</H2>
- <PRE>
- java.lang.Object
- <IMG SRC="../../../resources/inherit.gif" ALT="extended by "><B>com.toedter.calendar.DateUtil</B>
- </PRE>
- <HR>
- <DL>
- <DT><PRE>public class <B>DateUtil</B><DT>extends java.lang.Object</DL>
- </PRE>
-
- <P>
- A utility class for some date operations.
- <P>
-
- <P>
- <DL>
- <DT><B>Version:</B></DT>
- <DD>$LastChangedRevision: 95 $, $LastChangedDate: 2006-05-05 18:43:15 +0200 (Fr, 05 Mai 2006) $</DD>
- <DT><B>Author:</B></DT>
- <DD>Kai Toedter</DD>
- </DL>
- <HR>
-
- <P>
- <!-- =========== FIELD SUMMARY =========== -->
-
- <A NAME="field_summary"><!-- --></A>
- <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
- <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
- <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
- <B>Field Summary</B></FONT></TH>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE>protected java.util.Date</CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../com/toedter/calendar/DateUtil.html#defaultMaxSelectableDate">defaultMaxSelectableDate</A></B></CODE>
-
- <BR>
- </TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE>protected java.util.Date</CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../com/toedter/calendar/DateUtil.html#defaultMinSelectableDate">defaultMinSelectableDate</A></B></CODE>
-
- <BR>
- </TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE>protected java.util.Date</CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../com/toedter/calendar/DateUtil.html#maxSelectableDate">maxSelectableDate</A></B></CODE>
-
- <BR>
- </TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE>protected java.util.Date</CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../com/toedter/calendar/DateUtil.html#minSelectableDate">minSelectableDate</A></B></CODE>
-
- <BR>
- </TD>
- </TR>
- </TABLE>
-
- <!-- ======== CONSTRUCTOR SUMMARY ======== -->
-
- <A NAME="constructor_summary"><!-- --></A>
- <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
- <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
- <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
- <B>Constructor Summary</B></FONT></TH>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD><CODE><B><A HREF="../../../com/toedter/calendar/DateUtil.html#DateUtil()">DateUtil</A></B>()</CODE>
-
- <BR>
- </TD>
- </TR>
- </TABLE>
-
- <!-- ========== METHOD SUMMARY =========== -->
-
- <A NAME="method_summary"><!-- --></A>
- <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
- <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
- <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
- <B>Method Summary</B></FONT></TH>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE> boolean</CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../com/toedter/calendar/DateUtil.html#checkDate(java.util.Date)">checkDate</A></B>(java.util.Date date)</CODE>
-
- <BR>
- Checks a given date if it is in the formally specified date range.</TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE> java.util.Date</CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../com/toedter/calendar/DateUtil.html#getMaxSelectableDate()">getMaxSelectableDate</A></B>()</CODE>
-
- <BR>
- Gets the maximum selectable date.</TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE> java.util.Date</CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../com/toedter/calendar/DateUtil.html#getMinSelectableDate()">getMinSelectableDate</A></B>()</CODE>
-
- <BR>
- Gets the minimum selectable date.</TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE> java.util.Date</CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../com/toedter/calendar/DateUtil.html#setMaxSelectableDate(java.util.Date)">setMaxSelectableDate</A></B>(java.util.Date max)</CODE>
-
- <BR>
- Sets the maximum selectable date.</TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE> java.util.Date</CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../com/toedter/calendar/DateUtil.html#setMinSelectableDate(java.util.Date)">setMinSelectableDate</A></B>(java.util.Date min)</CODE>
-
- <BR>
- Sets the minimum selectable date.</TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE> void</CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../com/toedter/calendar/DateUtil.html#setSelectableDateRange(java.util.Date, java.util.Date)">setSelectableDateRange</A></B>(java.util.Date min,
- java.util.Date max)</CODE>
-
- <BR>
- Sets a valid date range for selectable dates.</TD>
- </TR>
- </TABLE>
- <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
- <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
- <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
- <TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD>
- </TR>
- </TABLE>
-
- <P>
-
- <!-- ============ FIELD DETAIL =========== -->
-
- <A NAME="field_detail"><!-- --></A>
- <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
- <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
- <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
- <B>Field Detail</B></FONT></TH>
- </TR>
- </TABLE>
-
- <A NAME="minSelectableDate"><!-- --></A><H3>
- minSelectableDate</H3>
- <PRE>
- protected java.util.Date <B>minSelectableDate</B></PRE>
- <DL>
- <DL>
- </DL>
- </DL>
- <HR>
-
- <A NAME="maxSelectableDate"><!-- --></A><H3>
- maxSelectableDate</H3>
- <PRE>
- protected java.util.Date <B>maxSelectableDate</B></PRE>
- <DL>
- <DL>
- </DL>
- </DL>
- <HR>
-
- <A NAME="defaultMinSelectableDate"><!-- --></A><H3>
- defaultMinSelectableDate</H3>
- <PRE>
- protected java.util.Date <B>defaultMinSelectableDate</B></PRE>
- <DL>
- <DL>
- </DL>
- </DL>
- <HR>
-
- <A NAME="defaultMaxSelectableDate"><!-- --></A><H3>
- defaultMaxSelectableDate</H3>
- <PRE>
- protected java.util.Date <B>defaultMaxSelectableDate</B></PRE>
- <DL>
- <DL>
- </DL>
- </DL>
-
- <!-- ========= CONSTRUCTOR DETAIL ======== -->
-
- <A NAME="constructor_detail"><!-- --></A>
- <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
- <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
- <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
- <B>Constructor Detail</B></FONT></TH>
- </TR>
- </TABLE>
-
- <A NAME="DateUtil()"><!-- --></A><H3>
- DateUtil</H3>
- <PRE>
- public <B>DateUtil</B>()</PRE>
- <DL>
- </DL>
-
- <!-- ============ METHOD DETAIL ========== -->
-
- <A NAME="method_detail"><!-- --></A>
- <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
- <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
- <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
- <B>Method Detail</B></FONT></TH>
- </TR>
- </TABLE>
-
- <A NAME="setSelectableDateRange(java.util.Date, java.util.Date)"><!-- --></A><H3>
- setSelectableDateRange</H3>
- <PRE>
- public void <B>setSelectableDateRange</B>(java.util.Date min,
- java.util.Date max)</PRE>
- <DL>
- <DD>Sets a valid date range for selectable dates. If max is before min, the
- default range with no limitation is set.
- <P>
- <DD><DL>
- <DT><B>Parameters:</B><DD><CODE>min</CODE> - the minimum selectable date or null (then the minimum date is
- set to 01\01\0001)<DD><CODE>max</CODE> - the maximum selectable date or null (then the maximum date is
- set to 01\01\9999)</DL>
- </DD>
- </DL>
- <HR>
-
- <A NAME="setMaxSelectableDate(java.util.Date)"><!-- --></A><H3>
- setMaxSelectableDate</H3>
- <PRE>
- public java.util.Date <B>setMaxSelectableDate</B>(java.util.Date max)</PRE>
- <DL>
- <DD>Sets the maximum selectable date. If null, the date 01\01\9999 will be set instead.
- <P>
- <DD><DL>
- <DT><B>Parameters:</B><DD><CODE>max</CODE> - the maximum selectable date
- <DT><B>Returns:</B><DD>the maximum selectable date</DL>
- </DD>
- </DL>
- <HR>
-
- <A NAME="setMinSelectableDate(java.util.Date)"><!-- --></A><H3>
- setMinSelectableDate</H3>
- <PRE>
- public java.util.Date <B>setMinSelectableDate</B>(java.util.Date min)</PRE>
- <DL>
- <DD>Sets the minimum selectable date. If null, the date 01\01\0001 will be set instead.
- <P>
- <DD><DL>
- <DT><B>Parameters:</B><DD><CODE>min</CODE> - the minimum selectable date
- <DT><B>Returns:</B><DD>the minimum selectable date</DL>
- </DD>
- </DL>
- <HR>
-
- <A NAME="getMaxSelectableDate()"><!-- --></A><H3>
- getMaxSelectableDate</H3>
- <PRE>
- public java.util.Date <B>getMaxSelectableDate</B>()</PRE>
- <DL>
- <DD>Gets the maximum selectable date.
- <P>
- <DD><DL>
-
- <DT><B>Returns:</B><DD>the maximum selectable date</DL>
- </DD>
- </DL>
- <HR>
-
- <A NAME="getMinSelectableDate()"><!-- --></A><H3>
- getMinSelectableDate</H3>
- <PRE>
- public java.util.Date <B>getMinSelectableDate</B>()</PRE>
- <DL>
- <DD>Gets the minimum selectable date.
- <P>
- <DD><DL>
-
- <DT><B>Returns:</B><DD>the minimum selectable date</DL>
- </DD>
- </DL>
- <HR>
-
- <A NAME="checkDate(java.util.Date)"><!-- --></A><H3>
- checkDate</H3>
- <PRE>
- public boolean <B>checkDate</B>(java.util.Date date)</PRE>
- <DL>
- <DD>Checks a given date if it is in the formally specified date range.
- <P>
- <DD><DL>
- <DT><B>Parameters:</B><DD><CODE>date</CODE> - the date to check
- <DT><B>Returns:</B><DD>true, if the date is within minSelectableDate and
- maxSelectableDate</DL>
- </DD>
- </DL>
- <!-- ========= END OF CLASS DATA ========= -->
- <HR>
-
-
- <!-- ======= START OF BOTTOM NAVBAR ====== -->
- <A NAME="navbar_bottom"><!-- --></A>
- <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
- <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
- <TR>
- <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
- <A NAME="navbar_bottom_firstrow"><!-- --></A>
- <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
- <TR ALIGN="center" VALIGN="top">
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
- <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
- </TR>
- </TABLE>
- </TD>
- <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
- </EM>
- </TD>
- </TR>
-
- <TR>
- <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
- PREV CLASS
- <A HREF="../../../com/toedter/calendar/IDateEditor.html" title="interface in com.toedter.calendar"><B>NEXT CLASS</B></A></FONT></TD>
- <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
- <A HREF="../../../index.html?com/toedter/calendar/DateUtil.html" target="_top"><B>FRAMES</B></A>
- <A HREF="DateUtil.html" target="_top"><B>NO FRAMES</B></A>
- <SCRIPT type="text/javascript">
- <!--
- if(window==top) {
- document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>');
- }
- //-->
- </SCRIPT>
- <NOSCRIPT>
- <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>
- </NOSCRIPT>
-
-
- </FONT></TD>
- </TR>
- <TR>
- <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
- SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
- <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
- DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
- </TR>
- </TABLE>
- <A NAME="skip-navbar_bottom"></A>
- <!-- ======== END OF BOTTOM NAVBAR ======= -->
-
- <HR>
- Copyright © 1999 - 2006 Kai Toedter.
- </BODY>
- </HTML>