Main Page | Modules | Directories | File List | File Members

calendar.js File Reference

Go to the source code of this file.

Variables

Zapatec Calendar
Zapatec Calendar _initSDN
Zapatec Calendar i18n
Zapatec Calendar _C = null
 "static", needed for event handlers.
Zapatec Calendar prefs
 preferences
Zapatec Calendar savePrefs
Zapatec Calendar loadPrefs
Zapatec Calendar _add_evs
Zapatec Calendar _del_evs
Zapatec Calendar findMonth
Zapatec Calendar findHist
Zapatec Calendar findYear
Zapatec Calendar showMonthsCombo
Zapatec Calendar showHistoryCombo
Zapatec Calendar showYearsCombo
Zapatec Calendar tableMouseUp
Zapatec Calendar tableMouseOver
Zapatec Calendar tableMouseDown
Zapatec Calendar calDragIt
Zapatec Calendar calDragEnd
Zapatec Calendar dayMouseDown
Zapatec Calendar dayMouseDblClick
Zapatec Calendar dayMouseOver
Zapatec Calendar dayMouseOut
Zapatec Calendar cellClick
Zapatec Calendar prototype create
Zapatec Calendar _keyEvent
Zapatec Calendar prototype _init
Zapatec Calendar prototype _initMultipleDates
Zapatec Calendar prototype _toggleMultipleDate
Zapatec Calendar prototype setDateToolTipHandler
Zapatec Calendar prototype setDate
Zapatec Calendar prototype showHint
Zapatec Calendar prototype reinit
Zapatec Calendar prototype refresh
Zapatec Calendar prototype setFirstDayOfWeek
Zapatec Calendar prototype setDateStatusHandler
Zapatec Calendar prototype setRange
Zapatec Calendar prototype setMultipleDates
Zapatec Calendar prototype submitFlatDates
Zapatec Calendar prototype updateHistory
Zapatec Calendar prototype callCloseHandler
Zapatec Calendar prototype destroy
Zapatec Calendar prototype reparent
Zapatec Calendar _checkCalendar
Zapatec Calendar prototype updateWCH
Zapatec Calendar prototype show
Zapatec Calendar prototype hide
Zapatec Calendar prototype showAt
Zapatec Calendar prototype showAtElement
Zapatec Calendar prototype setDateFormat
Zapatec Calendar prototype setTtDateFormat
Zapatec Calendar prototype parseDate
Zapatec Calendar prototype hideShowCovered
Zapatec Calendar prototype _displayWeekdays
Zapatec Utils compareDates
Zapatec Calendar prototype _dragStart
Date _MD = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
Date SECOND = 1000
Date MINUTE = 60 * Date.SECOND
Date HOUR = 60 * Date.MINUTE
Date DAY = 24 * Date.HOUR
Date WEEK = 7 * Date.DAY
Date prototype getMonthDays
Date prototype getDayOfYear
Date prototype getWeekNumber
Date prototype equalsTo
Date prototype dateEqualsTo
Date prototype setDateOnly
Date prototype print
Date prototype __msh_oldSetFullYear = Date.prototype.setFullYear
Date prototype setFullYear
Date prototype compareDatesOnly


Variable Documentation

Zapatec Calendar
 

The Calendar object constructor. Call it, for example, like this:

   // the following function is called when a date is clicked
   function selFunc(cal) {
      alert(cal.date);
   }
   // the following function is called when the calendar should be closed
   function closeFunc(cal) {
      cal.destroy();
   }
   var cal = new Zapatec.Calendar(1, new Date(), selFunc, closeFunc);

The above creates a new Calendar object. The Calendar isn't displayed instantly; using the "cal" variable, the programmer can now set certain configuration variables, hook his own event handlers and then display the calendar using Zapatec.Calendar.create().

Parameters:
firstDayOfWeek [int] the first day of week (0 for Sun, 1 for Mon, ...)
dateStr [string or Date] a string to be the default date, or a reference to a Date object
onSelected [function] this function will be called when a date is selected
onClose [function] this is called when the calendar should be closed

Definition at line 43 of file calendar.js.

Zapatec Calendar _initSDN
 

For internal use only.

This function is called from the constructor, only once, to initialize some internal arrays containing translation strings. It is also called from the calendar wizard in order to reconfigure the calendar with a language different than the initially selected one.

Definition at line 123 of file calendar.js.

Zapatec Calendar i18n
  Translate a string according to the currently loaded language table. The type variable can be null or missing, or can have one of the following values: "dn", "sdn", "mn", "smn".

  1. if type is null or missing, the given str will be looked up in the translation table. If a value is found, it is returned. Otherwise, the string is looked up in the English table (if present). If still not found, the value of str itself is returned.
  2. if type is passed, then the value of str is looked up in one of the following internal arrays, depending on the value of type:
    • DN (day name)
    • SDN (short day name)
    • MN (month name)
    • SMN (short month name)

Parameters:
str [string] ID of translation text (can be the English text)
type [string, optional] domain to search through
Returns:
the translation according to the current language.

Definition at line 165 of file calendar.js.

Zapatec Calendar _C = null
 

"static", needed for event handlers.

Definition at line 186 of file calendar.js.

Zapatec Calendar prefs
  preferences

Definition at line 189 of file calendar.js.

Zapatec Calendar savePrefs
  Writes the preferences cookie.

Definition at line 201 of file calendar.js.

Zapatec Calendar loadPrefs
  Loads the preference cookie and merges saved prefs to Zapatec.Calendar.prefs.

Definition at line 210 of file calendar.js.

Zapatec Calendar _add_evs
 

For internal use only.

Adds a set of events to make some element behave like a button.

Parameters:
el [HTMLElement] reference to your element.

Definition at line 227 of file calendar.js.

Zapatec Calendar _del_evs
 

For internal use only.

This function undoes what Zapatec.Calendar._add_evs did, therefore unregisters the event handlers.

Parameters:
el [HTMLElement] reference to your element.

Definition at line 242 of file calendar.js.

Zapatec Calendar findMonth
  Given an HTML element, this function determines if it's part of the "months" combo box and if so it returns the element containing the month name.

Parameters:
el [HTMLElement] some element (usually that triggered onclick)
Returns:
[HTMLElement] element with the month

Definition at line 258 of file calendar.js.

Zapatec Calendar findHist
  Similar to findMonth() but for the history combo.

Definition at line 268 of file calendar.js.

Zapatec Calendar findYear
  Similar to the above functions, but for the years combo.

Definition at line 278 of file calendar.js.

Zapatec Calendar showMonthsCombo
 

This function displays the months combo box. It doesn't need any parameters because it uses the static _C variable which maintains a reference to the last calendar that was clicked in the page.

Definition at line 292 of file calendar.js.

Zapatec Calendar showHistoryCombo
 

Same as the above, this function displays the history combo box for the active calendar.

Definition at line 337 of file calendar.js.

Zapatec Calendar showYearsCombo
 

Displays the years combo box for the active calendar. The "fwd" parameter tells it if it should display future (right) or past (left) years.

Parameters:
fwd [boolean] true if it's for the right combo (future), false otherwise.

Definition at line 376 of file calendar.js.

Zapatec Calendar tableMouseUp
 

This is an event handler that gets called when the mouse button is released upon the document. The name (tableMouseUp) is because of historic reasons (in the initial calendar versions this event was triggered by the calendar table, but now it's the document who does it).

This function does a number of things. It determines which is the element that was actually clicked. Note that the "mouseup" event usually means "something was clicked"; it's "mouseup" who fires the "onclick" event, not "mousedown" ;-). So, if the clicked element is a member of one of the combo boxes such as month, year or history, then the appropriate action is taken (switch month, year or go to history date).

Also, the Zapatec.Calendar.cellClick() function is called, which further examines the target element and might do other things.

Finally, this handler deregisters itself (it's automatically enabled at "mousedown" on document), stops the event propagation, sets the static _C variable to null (meaning "no calendar is currently in use").

Parameters:
ev [Event] the event object
Returns:
false

Definition at line 447 of file calendar.js.

Zapatec Calendar tableMouseOver
 

Event handler that gets called when the end-user moves the mouse over the document.

This function is pretty complicated too. It adds hover/active state class to elements that are highlighted and/or clicked. It determines whether one is trying to modify the time by "drag'n'drop" (the original interface implemented by the calendar). Finally, it determines if the mouse is over combo box items, also adding/removing hover states and setting some calendar variables with reference to the element involved.

Parameters:
ev 
Returns:

Definition at line 527 of file calendar.js.

Zapatec Calendar tableMouseDown
  This is a simple function that stops a "mousedown" related to the calendar's table element. This helps avoiding text selection in certain browsers (most notably, Safari, since Mozilla already has a better way).

Parameters:
ev [Event] the Event object
Returns:
false

Definition at line 682 of file calendar.js.

Zapatec Calendar dayMouseDown
 

Called when the mouse button is pressed upon a button. The name of this function is so for historical reasons; currently, this function is used for any type of buttons used in the calendar, not only "days".

This function does quite some things. It checks if the clicked cell is the title bar or the status bar, in which case it starts the calendar dragging mechanism (cal._dragStart()). If the cell is a time part, then it registers Zapatec.Calendar.tableMouseOver() event handler on the document. If the cell is a "navigation" button (next/prev year or month, or today) then a timeout is created that will show the appropriate combo box if the button is not quickly depressed.

Parameters:
ev [Event] the event object
Returns:
false

Definition at line 759 of file calendar.js.

Zapatec Calendar dayMouseDblClick
  For IE5 we can't make unselectable elements, but we can void the selection immediately after the double click event :D. This function is a double click handler which does exactly that. Uses IE-specific functions.

Definition at line 812 of file calendar.js.

Zapatec Calendar dayMouseOver
 

This function gets called at "onmouseover" events that trigger on any kind of button, like dates, navigation buttons, etc. Basically, the function computes and caches the tooltip (if it's a date cell for instance) and displays it in the status bar. If the cell is not a navigation button, it will also add "rowhilite" class to the containing TR element.

Parameters:
ev [Event] the event object.
Returns:
false

Definition at line 828 of file calendar.js.

Zapatec Calendar dayMouseOut
  Gets called when the mouse leaves a button. This function "undoes" what dayMouseOver did, that is, it removes the "rowhilite" class from the containing TR and restores the status bar display to read "Select date".

Parameters:
ev [Event] the event object.
Returns:
false

Definition at line 872 of file calendar.js.

Zapatec Calendar cellClick
 

The generic "click" handler. This function handles actions on any kind of buttons that appear inside our calendar. It determines the button type by querying el.navtype. The following types of objects are supported:

  • Date cells (navtype is undefined). The function will select that date, add appropriate class names and remove them from the previously selected date. If the date in the calendar has changed, it calls the calendar's onSelect handler (see the constructor). If multiple dates is enabled, it will not unselect previously selected date but rather maintain an array of dates which will be avaliable to the onSelect or onClose handler.
  • The Close button (navtype == 200). If this is clicked, then the calendar's onClose handler is called immediately.
  • The Today button (navtype == 0). The calendar will jump to the "today" date and time, unless it's already there.
  • The About button (navtype == 400). It will display an alert with the "about message", as defined in the translation file.
  • Previous year (navtype == -2)
  • Previous month (navtype == -1)
  • Next month (navtype == 1)
  • Next year (navtype == 2)
  • Day names (navtype == 100). If any of them is clicked, the calendar will display that day as the first day of week. It calls the "onFDOW" event handler if defined.
  • Time parts (navtype == 50). If any of them is clicked, this function will determine if it's a click or shift-click, and will take the appropriate action (simple click means add 1, shift-click means substract 1 from that time part). Then it calls onUpdateTime() to refresh the display.
  • Time scroll buttons (navtype == 201 or navtype == 202). If such buttons are clicked, the time part involved is determined and it is incremented or decremented with the current step (default: 5). 201 is for "add", 202 for "substract".

Parameters:
el [HTMLElement] the object being clicked on
ev [Event] the event object

Definition at line 927 of file calendar.js.

Zapatec Calendar prototype create
 

This function creates the calendar HTML elements inside the given parent. If _par is null than it creates a popup calendar inside the BODY element. If _par is an element, be it BODY, then it creates a non-popup calendar (still hidden).

The function looks rather complicated, but what it does is quite simple. The basic calendar elements will be created, that is, a containing DIV, a TABLE that contains a headers (titles, navigation bar and day names bars), a body containing up to 12 months, each has 6 rows with 7 or 8 cells (this depends on whether week numbers are on or off) and a footer containing the status bar. Appropriate event handlers are assigned to all buttons or to the titles and status bar (for drag'n'drop).

This function also builds the time selector if the calendar is configured so, and it also creates the elements required for combo boxes (years, months, history).

This function does not display day names or dates. This is done in Zapatec.Calendar.prototype._init(). Therefore, by separating these 2 actions we can make date switching happen much faster because the _init function will already have the elements in place (so we don't need to create them again and again). This was a major improvement which got in the calendar v0.9.1.

Parameters:
_par 

Definition at line 1256 of file calendar.js.

Zapatec Calendar _keyEvent
 

This function handles keypress events that occur while a popup calendar is displayed. The implementation is quite complicated; this function calls cellClick in order to set the new date as if it was clicked.

Parameters:
ev [Event] the event object
Returns:
false

Definition at line 1687 of file calendar.js.

Zapatec Calendar prototype _init
 

(RE)Initializes the calendar to the given date and firstDayOfWeek.

This function perform the action of actually displaying the day names and dates in the calendar. But first, it checks if the passed date fits in the allowed range, configured by the "minYear", "maxYear", "minMonth" and "maxMonth" properties of the Calendar object.

It takes care to highlight special days (calling the calendar.getDateStatus() function which can be overridden by external scripts) or to highlight any dates that might be selected (for instance when multiple dates is on, this function will call _initMultipleDates() to highlight selected dates accordingly).

This function is highly optimized for speed, therefore the code in it is not trivial and what it does might not seem obvious. :-) So, WARNING, this is voodoo. If you want to properly understand the code you should analyze it line by line and try to execute it step by step; use the Venkman JS debugger.

Parameters:
firstDayOfWeek [int] the first day of week, 0 for Sunday, 1 for Monday, etc.
date [Date] the date to initialize the calendar to
Returns:

Definition at line 1782 of file calendar.js.

Zapatec Calendar prototype _initMultipleDates
  If "multiple dates" is selected (the calendar.multiple property) this function will highlight cells that display dates that are selected. It is only called from the _init() function.

Definition at line 2104 of file calendar.js.

Zapatec Calendar prototype _toggleMultipleDate
  Given a Date object, this function will "toggle" it in the calendar; that is, it will select it if not already selected, or unselect it if was already selected. The array of dates is updated accordingly and the cell object will be added or removed the appropriate class name ("selected"). Of course, this only takes place if "multiple dates" is selected.

Parameters:
date [Date] the date to (un)select.

Definition at line 2126 of file calendar.js.

Zapatec Calendar prototype setDateToolTipHandler
  Call this in order to install a function handler that returns a tooltip for the given date. For example:

   function myHandler(date) {
      var str = date.print("%Y/%m/%d");
      if (str == "1979/08/03") {
         return "Happy birthday Mishoo! :D";
      }
      return str;
   }
   calendar.setDateToolTipHandler(myHandler);

The tooltip handler is a "unary" function (receives one argument). The argument passed is a date object and the function should return the tooltip for that date.

Parameters:
unaryFunction [function] your tooltip handler, as described above

Definition at line 2164 of file calendar.js.

Zapatec Calendar prototype setDate
  Moves the calendar to the specified date. If date is not passed, then the "today" date is assumed. This function does range checking and displays an error in the status bar if the new date is not allowed by the configured calendar range. Otherwise, it simply calls _init() with the new date.

Parameters:
date [Date, optional] the date object.

Definition at line 2176 of file calendar.js.

Zapatec Calendar prototype showHint
  Displays a hint in the status bar

Parameters:
text [string] what to display

Definition at line 2195 of file calendar.js.

Zapatec Calendar prototype reinit
  Refreshes the calendar. Useful if the "disabledHandler" function is dynamic, meaning that the list of disabled date can change at runtime. Just call this function if you think that the list of disabled dates should change.

This function simply calls _init() using the current firstDayOfWeek and the current calendar date.

Definition at line 2208 of file calendar.js.

Zapatec Calendar prototype refresh
  "refresh()" isn't a good name for it: this function _destroys_ the calendar object and creates another one with the same parameters. This comes in handy for the calendar wizard where we need to reconstruct the calendar for virtually any property change.

Definition at line 2218 of file calendar.js.

Zapatec Calendar prototype setFirstDayOfWeek
  Configures the "firstDayOfWeek" parameter of the calendar.

Parameters:
firstDayOfWeek [int] the new first day of week, 0 for Sunday, 1 for Monday, etc.

Definition at line 2236 of file calendar.js.

Zapatec Calendar prototype setDateStatusHandler
  These functions allow one to install a handler that gets called for each date when a month is displayed in the calendar. Based on this handler's return value, that date can be disabled or highlighted using a class name returned by the handler.

The handler has the following prototype:

   function dateStatus(date, year, month, day);

While all 4 parameters are passed, the handler can for instance use only the first one. The year, month and day can all be determined from the first parameter which is a Date object, but because many people will explicitely need the year, month or day, we pass them too to speed things up (since we already know them at the time the handler is called).

Here is an example of a not-so-complex handler:

   function my_DateStatus(date, year, month, day) {
      var str = date.print("%Y/%m/%d");
      if (str >= '2000/01/01' && str <= '2000/12/31') {
         return true; // disable all dates in 2000
      }
      if (str == "1979/08/03") {
         return "birthday";
      }
      return false;
   }
   calendar.setDateStatusHandler(my_DateStatus);

The above handler will disable all dates in 2000 (returns true) and highlight "1979/08/03" using the class "birthday". From this example we can notice that the handler can return a boolean value or a string value. The "boolean" return type is supported for backwards compatibility (function setDisabledHandler, which is deprecated by setDateStatusHandler). Here's what the return value means:

  • true: the date will be disabled.
  • false: no action taken (date stays enabled).
  • "disabled": the date will be disabled.
  • "other_string": the "other_string" will be added to the cell's class name.
  • "disabled other_string": the date will be disabled and "disabled other_string" will be added to cell's class name; this helps one make a date disabled while still highlighting it in a special way.

Note that user defined class names should have an associated CSS part somewhere in the document that specifies how the days will look like; otherwise, no difference will be visible. For instance, for highlighting "birthday" dates, one should also add:

   .birthday { color: #f00; }

somewhere in the CSS of the calling document. (the above will make them red).

Disabled dates are not clickable; however, if one overrides the "disable" CSS class, or if the cell also gets an "other_string" class that contains settings that override the "disabled" class, those cells might not look "disabled" but still behave so.

WARNING: this function gets called 28 to 31 times each time a month is displayed. This means that if you are doing crazy computations in order to determine the status of a day, things will slow down dramatically. You have been warned.

Parameters:
unaryFunction [function] handler that decides the status of the passed date

Definition at line 2324 of file calendar.js.

Zapatec Calendar prototype setRange
  Configures a range of allowed dates for the calendar. Currently, this function supports setting a range on a "month granularity". This means, using it you can't disable part of a month. Both parameters are numeric and can be float. The range is "inclusive".

This function might seem somehow complicated, but it's designed in a way that keeps backwards compatibility with the calendar v0.9.6.

  1. when the end points are integers, the full years will be included. That is, if you call calendar.setRange(1999, 2005) then only dates between and including 1999/01/01 and 2005/12/31 will be allowed.
  2. when the end points are floats, the decimal part specifies the month. Therefore, calendar.setRange(1999.03, 2005.05) will allow dates between and including 1999/03/01 (March 1) and 2005/05/31 (May 31).

The above statements mean that the following two lines are equivalent:

   calendar.setDate(1999, 2005);       // or
   calendar.setDate(1999.01, 2005.12);

Parameters:
A [number] the range start point
Z [number] the range end point

Definition at line 2354 of file calendar.js.

Zapatec Calendar prototype setMultipleDates
  This function sets up the cal.multiple property initially when the flat or popup calendar is created. If there are dates to be displayed or added to the first time, this property will be filled with those dates at the beginning.

multiple -- [Array] - stores the current dates for future use and appending of additional dates

Definition at line 2371 of file calendar.js.

Zapatec Calendar prototype submitFlatDates
 

Call the calendar's callback function, if defined. The passed argument is the date object. This is a public function meant to be invoked by the user so that s/he can have more controls on what to do with the dates selected.

Definition at line 2387 of file calendar.js.

Zapatec Calendar prototype updateHistory
  This function updates the calendar history and saves the cookie. The history is a string containing date and time formatted as "%Y/%m/%d/%H/%M" (that is, all time parts separated by slashes, in a "most significant to least significant order"). Further, such formats are separated by commas, and the current calendar date is added the first, then the cookie saved.

Definition at line 2437 of file calendar.js.

Zapatec Calendar prototype callCloseHandler
  Calls the calendar's onClose handler, if present. Either way, this function calls updateHistory() in order to update the history cookie.

Definition at line 2458 of file calendar.js.

Zapatec Calendar prototype destroy
  Removes the calendar object from the DOM tree and destroys it.

Definition at line 2469 of file calendar.js.

Zapatec Calendar prototype reparent
  Moves the calendar element to a different section in the DOM tree (changes its parent). This might be useful for flat calendars.

Parameters:
new_parent [HTMLElement] the new parent for the calendar.

Definition at line 2483 of file calendar.js.

Zapatec Calendar _checkCalendar
  This gets called when the user presses a mouse button anywhere in the document, if the calendar is shown. If the click was outside the open calendar this function closes it and stops the event from propagating.

Parameters:
ev [Event] the event object.
Returns:
false if the event is stopped.

Definition at line 2497 of file calendar.js.

Zapatec Calendar prototype updateWCH
  Updates the calendar "WCH" (windowed controls hider). A WCH is an "invention" (read: "miserable hack") that works around one of the most common and old bug in Internet Explorer: the SELECT boxes or IFRAMES show on top of any other HTML element. This function makes sure that the WCH covers correctly the calendar element and another element if passed.

Parameters:
other_el [HTMLElement, optional] a second element that the WCH should cover.

Definition at line 2519 of file calendar.js.

Zapatec Calendar prototype show
  Displays a hidden calendar. It walks quickly through the HTML elements and makes sure that they don't have "hover" or "active" class names that might be there from a previous time the same calendar was displayed. This function also calls updateWCH() and hideShowCovered() to workaround miserable IE bugs.

If the calendar is a popup calendar and doesn't have the "noGrab" property set, this function also adds document event handlers to intercept key events or to close the calendar when one clicks outside it.

Definition at line 2534 of file calendar.js.

Zapatec Calendar prototype hide
  Hides the calendar. Also removes any "hilite" from the class of any TD element. Unregisters the document event handlers for key presses and mousedown.

Definition at line 2565 of file calendar.js.

Zapatec Calendar prototype showAt
  Shows the calendar at a given absolute position (beware that, depending on the calendar element style -- position property -- this might be relative to the parent's containing rectangle).

Parameters:
x [int] the X position
y [int] the Y position

Definition at line 2585 of file calendar.js.

Zapatec Calendar prototype showAtElement
 

This function displays the calendar near a given "anchor" element, according to some rules passed in opts. The opts argument is a string containing one or 2 letters. The first letter decides the vertical alignment, and the second letter decides the horizontal alignment relative to the anchor element. Following we will describe these options; in parens we will use simple descriptions like "top to bottom" which means that the top margin of the calendar is aligned with the bottom margin of the object.

Vertical align:

  • T -- the calendar is completely above the element (bottom to top)
  • t -- the calendar is above the element but might overlap it (bottom to bottom)
  • C -- the calendar is vertically centered to the element
  • b -- the calendar is below the element but might overlap it (top to top)
  • B -- the calendar is completely below the element (top to bottom)

Horizontal align (defaults to 'l' if no letter passed):

  • L -- the calendar is completely to the left of the element (right to left)
  • l -- the calendar is to the left of the element but might overlap it (right to right)
  • C -- the calendar is horizontally centered to the element
  • r -- the calendar is to the right of the element but might overlap it (left to left)
  • R -- the calendar is completely to the right of the element (left to right)

Parameters:
el [HTMLElement] the anchor element
opts [string, optional] the align options, as described above. Defaults to "Bl" if nothing passed.

Definition at line 2620 of file calendar.js.

Zapatec Calendar prototype setDateFormat
  Customizes the date format that will be reported to the onSelect handler. The format string is described in Date.prototype.print().

Parameters:
str [string] the date format.

Definition at line 2665 of file calendar.js.

Zapatec Calendar prototype setTtDateFormat
  Customizes the tooltip date format. See Zapatec.Calendar.prototype.setDateFormat() for a description of the str format.

Parameters:
str [string] the "tooltip" date format

Definition at line 2675 of file calendar.js.

Zapatec Calendar prototype hideShowCovered
 

This function hides or shows "windowed controls" accordingly so that the calendar isn't obtured by any such control. Historically, this function was used for any browser. It simply walks through all SELECT, IFRAME and APPLET elements present in the DOM, checks if they intersect the calendar and hides them if so or makes them visible otherwise. This approacy has a number of problems, the most important being that if the end-user's code contains a SELECT which is already hidden and it must stay hidden, it will still be made visible when the calendar closes. The other obvious problem is that there's an ugly effect generated by elements that suddenly (dis)appear when you drag the calendar around the screen.

Currently this function is only used on IE5.0/Windows, browser that leaves no room for a better workaround to this problem. For IE5.5+/Windows an workaround is possible, albeit amazingly ugly (WCH). For other browsers such crazy techniques are not anymore useful because the bugs related to windowed controls were fixed.

Definition at line 2714 of file calendar.js.

Zapatec Calendar prototype _displayWeekdays
 

This function displays the week day names in the calendar header, according to the current "firstDayOfWeek".

Definition at line 2776 of file calendar.js.

Zapatec Utils compareDates
  Compare two dates in either ascending or descending order. To be used for the multiple dates feature. This function is passed as an argument to the sort routine which calls it to compare dates.

Parameters:
date1 [date] first date
date2 [date] second date

Definition at line 2822 of file calendar.js.

Zapatec Calendar prototype _dragStart
 

For internal use only.

Starts dragging the element.

Definition at line 2839 of file calendar.js.

Date prototype compareDatesOnly
  This function compares only years, months and days of two date objects.

Returns:
[int] -1 if date1>date2, 1 if date2>date1 or 0 if they are equal
Parameters:
date1 [Date] first date to compare
date1 [Date] second date to compare global object that remembers the calendar

Definition at line 3165 of file calendar.js.