<docbook><section><title>OATDOCcalendar</title><para> </para>
<title> calendar.js</title> calendar.js
<para>Displays a calendar for date picking.</para>
<bridgehead class="http://www.w3.org/1999/xhtml:h2"> Objects</bridgehead>
<bridgehead class="http://www.w3.org/1999/xhtml:h3"> OAT.Calendar(optObj)</bridgehead>
<para>Instantiates the <computeroutput>OAT.Calendarobject.optObj</computeroutput> may contain:</para>
<itemizedlist mark="bullet" spacing="compact"><listitem>popup- bool; should clicking anywhere close the calendar? (default: <computeroutput>false</computeroutput>)</listitem>
</itemizedlist><bridgehead class="http://www.w3.org/1999/xhtml:h2"> Methods</bridgehead>
<bridgehead class="http://www.w3.org/1999/xhtml:h3"> OAT.Calendar::show(x, y, callback, [date])</bridgehead>
<para>Shows the calendar.
 It will appear at <computeroutput>[x, y]</computeroutput>.
 If <computeroutput>date</computeroutput> is specified, it will be pre-selected.
 All dates are in form of <computeroutput>[year, month, day]</computeroutput>, starting from 1.
 When user selects a date, a <computeroutput>callback(date)</computeroutput> will be called.</para>
<bridgehead class="http://www.w3.org/1999/xhtml:h2"> Properties</bridgehead>
<bridgehead class="http://www.w3.org/1999/xhtml:h3"> OAT.Calendar.dayNames</bridgehead>
<para>array of 7 day names</para>
<bridgehead class="http://www.w3.org/1999/xhtml:h3"> OAT.Calendar.monthNames</bridgehead>
<para>array of 12 month names</para>
<bridgehead class="http://www.w3.org/1999/xhtml:h3"> OAT.Calendar.specialDays</bridgehead>
<para>array specifying which days should be special (weekends)</para>
<bridgehead class="http://www.w3.org/1999/xhtml:h3"> OAT.Calendar.weekStartIndex</bridgehead>
<para>index of day (in <computeroutput>OAT.Calendar.dayNames</computeroutput>) when week starts</para>
<bridgehead class="http://www.w3.org/1999/xhtml:h3"> OAT.Calendar.dayZeroIndex</bridgehead>
<para>index of day (in <computeroutput>OAT.Calendar.dayNames</computeroutput>) for which <computeroutput>Date::getDay()</computeroutput> returns 0, i.e., &quot;Sun&quot;.</para>
<bridgehead class="http://www.w3.org/1999/xhtml:h2"> CSS classes</bridgehead>
<bridgehead class="http://www.w3.org/1999/xhtml:h3"> .calendar</bridgehead>
<para>CSS class of calendar div.</para>
<bridgehead class="http://www.w3.org/1999/xhtml:h3"> .calendar_selected</bridgehead>
<para>CSS class of previously selected day.</para>
<bridgehead class="http://www.w3.org/1999/xhtml:h3"> .calendar_special</bridgehead>
<para>CSS class of special days, e.g., Sundays, holidays.</para>
<bridgehead class="http://www.w3.org/1999/xhtml:h3"> .calendar_year</bridgehead>
<para>CSS class of div containing the year title and selection.</para>
<bridgehead class="http://www.w3.org/1999/xhtml:h3"> .calendar_month</bridgehead>
<para>CSS class of div containing the month title and selection.</para>
<bridgehead class="http://www.w3.org/1999/xhtml:h2"> Example</bridgehead>
<programlisting>var c = new OAT.Calendar();
c.dayNames = [&quot;Mon&quot;,&quot;Tue&quot;,&quot;Wed&quot;,&quot;Thu&quot;,&quot;Fri&quot;,&quot;Sat&quot;,&quot;Sun&quot;];
c.monthNames = [&quot;Jan&quot;,&quot;Feb&quot;,&quot;Mar&quot;,&quot;Apr&quot;,&quot;May&quot;,&quot;Jun&quot;,&quot;Jul&quot;,&quot;Aug&quot;,&quot;Sep&quot;,&quot;Oct&quot;,&quot;Nov&quot;,&quot;Dec&quot;];
c.specialDays = [0,0,0,0,0,1,1];
c.dayZeroIndex = 6;
c.weekStartIndex = 6;
c.show(100, 100, function(){});
</programlisting><para> <ulink url="CategoryOAT">CategoryOAT</ulink> <ulink url="CategoryOpenSource">CategoryOpenSource</ulink> <ulink url="CategoryDocumentation">CategoryDocumentation</ulink></para>
</section></docbook>