The coolest DHTML calendar, v. 0.9

Theme [ winter | summer | green | win2k-1 | win2k-2 | win2k-cold-1 | win2k-cold-2 ] current: win2k-1

Flat calendar

A non-popup version will appear below as soon as the page is loaded.

The example above uses the setDisabledHandler() member function to setup a handler that would only enable days withing a range of 10 days, forward or backward, from the current date.

Easy I18N: all messages are separate JS files (see calendar-en.js, calendar-ro.js, calendar-it.js and calendar-fr.js. You just need to include the right one from the HTML page.

It's very easy to include a new language by just adding such file. Those interested to include the language of their choice in future releases are welcome to send me the language files.

Popup examples

Date #1: [y-m-d] -- single click
Date #2: [DD, MM d, y] -- double click

this select should hide when the calendar is above it.

Date #3: [dd/mm/y] -- single click
Date #4: [D, M d, y] -- double click

You can find more information about this script (and how to use/customize it) on my page.

This is release 0.9. Works on MSIE 5.0, 5.5, 6.0, Mozilla, Netscape 6.x, 7.0 and all other Gecko-s.

You can click on "Mo"/"Su" (first day name displayed) to change the first day of week (Sunday/Monday) (since 0.8 this is also mapped on the "-" button in the top-left corner). Use the navigation buttons ("<<", "<", "Today", ">", ">>") to move to the prev/next year/month. Keep the mouse button pressed for a short time over one of these buttons to get a menu for faster selection. You can drag the "status bar" (that's where the tooltips appear) or title bar (that's where the currently selected month/year shows up) to move the whole calendar.

Date formatting

Date parsing

The algorithm will first try to read the date in the specified format.

If it doesn't work, it will try different methods to recognize a valid date -- general behavior is: if some part of the input is the name of a month, i.e. "Mar", then that will be considered the month, the next/previous 1 .. 31 number will be considered the date and the next big number (hopefully there) will be the year; if it's missing we assume the current year. If no such name exists, then the first 1 .. 12 number will be taken as the month, the next 1 .. 31 as the date; year selection is the same as discussed.

Examples: 3/8/1979 as well as 03 08 79 as well as 1979 mar 8, as well as 79+3+8 will all lead to the same date: my birthday (March 8, 1979). To try the algo, just input the date using whatever format you like in one of the fields above and click on the "..." button. The calendar that shows up should contain your date, otherwise you and this algorithm don't get too well together :)


Author: Mihai Bazon © 2002
Feel free to use / redistribute under the GNU GPL.
Please no not remove or alter the comment at the script start.

If you use this script on a public page it would be nice if you would let me know.