Javascript Calendar Widget 1.08
Due to popular request, here is another minor update to the calendar that contains flags to setup Sunday as the first day of the week, and options to disable Saturday and Sunday, and since many complain that the first post containing the setup is confusing, here are the full options available for the calendar. Remember, all of this flags are optional, but must be defined before your include the javascript file.
click here to download the calendar
DESCRIPTION
This script is meant to be used as a date picker or date display.
SETUP
All the flags below are optional. Define only what you need!. You can find some calendar examples at the bottom of the page.
iMonth
Option: defines the default month for the calendar
Values: 0-11 (January – December)
Default: PC date.
iYear
Option: defines the default year for the calendar
Values: Year, 4 digits format
Default: PC date.
iDay
Option: defines the default day for the calendar
Values: 1-31
Default: PC date.
itype
Option: See the description below regarding imaxDays,stDay,stMonth,stYear
Values: “strict” or “loose”
Default: “loose”
imaxDays
Option: days can be selected only on this range of days (specified by a number) starting with startDay,startMonth,startYear(see below). imaxDays only counts if itype is “strict”.
Values: >0
startDay
Option: enable date selection from this day forward counting imaxDays
Values: 1-31
Default: iDay.
startMonth
Option: enable date selection from this month forward counting imaxDays
Values: 0-11
Default: iMonth.
startYear
Option: enable date selection from this year forward counting imaxDays
Values: year, 4 digit format
Default: iYear.
saturdayOff
Option: Disables selection for saturdays (this is independent from imaxDays and itype)
Values: true/false
Default: false
sundayOff
Option: Disables selection for sundays (this is independent from imaxDays
and itype)
Values: true/false
Default: false
sundayFirst
Option: Displays the calendar with sunday as the first day of the week.
Values: true/false
Default: false
offX
Option: x distance from the mouse for the popup calendar
Values: >0
Default: 10.
offY
Option: y distance from the mouse for the popup calendar
Values: >0
Default: -10.
formatSplitter
Option: date separator
Values: string
Default: “-”.
monthFormat
Option: month format on the input. June will be displayed as “Jun” in “mmm” format or as “06″ in “mm” format.
Values: “mmm” or “mm”
Default: “mm”
yearFormat
Option: year format on the input. 2009 will be displayed as “2009″ in “yyyy” format or as “09″ in “yy” format.
Values: “yyyy” or “yy”
Default: “yyyy”
callNotice
Option: Call a function when a date is selected
Values: “function name”
Default: “fallsilent()”
click here to download the calendar
EXAMPLES
A simple example that formats the date output to yy/mmm/dd
An example that sets sunday as the first day of the week
An example that enables date selection for this year.
A simple example that disables date selection for weekend days.
A simple example that calls a custom function when a date is picked.
Enjoy!
P.S. Since the old versions of the calendar gathered more than 5.000 downloads, I’m curious how people use it. So, if you have used the calendar on a public page, please leave a comment with the link where you have it running so it can be used as examples for others.
Thanks:)
L.E I’m also open to sugesstions, features & bugs you might find.

javascript calendar widget at Tools and how to’s on 21 Jun 2009 at 5:20 pm
[...] THIS VERSION IS NOW DEPRECATED. THE NEW VERSION CAN BE FOUND HERE [...]