Fcp.Calendar is a tiny, self-contained Javascript library. It displays a monthly Gregorian calendar. An event is triggered every time the user clicks on a date.
Demo
Download
Fcp.Calendar 1.1 is subject to the MIT license.
Features
- tiny - only 7.5Kb uncompressed;
- fully customizable looks via CSS;
- can be easily synchronised with one or more <input /> elements, so as to degrade gracefully;
- option to display US-style calendar (with Sunday first);
- simple to port to, say, ActionScript.
Compatibility
Tested on Firefox/Seamonkey, Opera 9+, Konqueror 3.2+ and Internet Explorer 6; it works fine on these.
Bugs
There is a bug which makes the calendar skip a month when going forward first time from January. It's no big deal, but I couldn't find the cause.
Frequently asked question
(just one - thanks, Michael)
- Q. How do I get the date in ISO format (e.g. 2006-12-21)?
-
A. Run your Javascript Date() instance through the following
function:
function dateToISO(date) { var year = date.getFullYear(); var month = date.getMonth() + 1; var day = date.getDate(); if (month < 10) month = "0" + month; if (day < 10) day = "0" + day; return year + "-" + month + "-" + day; }(syntax highlighting courtesy of JUSH)
Last modified: Thu 01 04 2010, 11:55:08 UTC
