Turn any JavaScript Date object, or a string containing a date that can be parsed with Date.parse() into a calendar icon (64x64px).
This plugin requires jQuery. It has been tested with 1.5.2, but I believe it would work with older releases (it's a very simple plugin).
var myDate = new Date();
$('p#calendar-icon').calendarIcon(myDate);
The widget is fully customizable using the supplied CSS and the calendar image. Please refer to the CSS source code to find out more about skinning the calendar icon. The code should be self-explanatory.
calendarIcon does not use the text of the element on which it is called. This will be fixed in future version, so if you do not supply a date object or date string to calendarIcon, it will try to get the date from the element on which it is called.
The calendarIcon plugin hasn't been widely tested yet. It works on FireFox 3.6 and Google Chrome. If you find issues with the plugin, be sure to notify us.
This plugin is published under the terms of MIT license.
Copyright (c) 2011 Branko Vukelic [email protected], Herd Hound <www.herdhound.com> All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.