Dynarch.com LLC, www.dynarch.com
This material is copyright
c
Dynarch.com, 2005
property type description default
ifFormat string The format string that will be used to enter the
date in the input field. This format w ill be hon-
ored even if the input field is hidden.
“%Y/%m/%d”
daFormat string Format of the date displayed in the displayArea
(if specified).
“%Y/%m/%d”
singleClick boolean Wether the calendar is in “single-click mode” or
“double-click mode”. If true (the default) the
calendar will b e created in single-click mode.
true
disableFunc function A function that receives a JS Date object. It
should return true if that date has to be dis-
abled, false otherwise. DEPRECATED (see
below).
null
dateStatusFunc function A function that receives a JS Date object and
returns a boolean or a string. This function al-
lows one to set a certain CSS class to some date,
therefore making it look different. If it returns
true then the date will be disabled. If it returns
false nothing special happens with the given
date. If it returns a string then that will be
taken as a CSS class and appended to the date
element. If this string is “disabled” then the
date is also disabled (therefore is like returning
true). For more information please also refer to
section 5.3.8.
null
firstDay integer Specifies which day is to be displayed as the first
day of week. Possible values are 0 to 6; 0 means
Sunday, 1 means Monday, ..., 6 means Satur-
day. The end user can easily change this too, by
clicking on the day name in the calendar header.
0
weekNumbers boolean If “true” then the calendar will display week
numbers.
true
align string Alignment of the calendar, relative to the refer-
ence element. The reference element is dynami-
cally chosen like this: if a displayArea is specified
then it will be the reference element. Otherwise,
the input field is the reference element. For the
meaning of the alignment characters please sec-
tion 5.3.11.
“Bl”
range array An array having exactly 2 elements, integers. (!)
The first [0] element is the minimum year that
is available, and the second [1] element is the
maximum year that the calendar w ill allow.
[1900, 2999]
flat string If you want a flat calendar, pass the ID of the
parent object in this property. If not, pass null
here (or nothing at all as null is the default
value).
null
flatCallback function You should provide this function if the calendar
is flat. It will be called when the date in the
calendar is changed with a reference to the cal-
endar object. See section 2.2 for an example of
how to setup a flat calendar.
null
onSelect function If you provide a function handler here then you
have to manage the “click-on-date” event by
yourself. Look in the calendar-setup.js and take
as an example the onSelect handler that you can
see there.
null
onClose function This handler will be called when the calen-
dar needs to close. You don’t need to provide
one, but if you do it’s your responsibility to
hide/destroy the calendar. You’re on your own.
Check the calendar-setup.js file for an example.
null
2.3 Calendar.setup in detail 5 / 20