published on January 22, 2012 in technical
1. The Goal.
As stated on the Github page, the goal of the developer team was to create a datepicjer that doesn't suck. And I must say I aggree. There are many datepickers out there, but not so many that may be called good. One of them is the jQuery datepicker, which is ok, but it neads jQuery. Loading jQuery just to have a datepicker available, should not be the case.
- No dependencies
- Fully and easily skinable
- Single day, multiple day and date range selection (range, hurray!)
- It may be displayed inline, or as a widget
- moment.js already bundled, for increased ease of usage
Include the downloaded scripts in your HTML document:
Then, for the simplest way of use, you only need to add a class to the element you want to hook Kalendae to.
<div class="auto-kal"></div> <input type="text" class="auto-kal" />
I case this is not enough for you, then you should use the manual initialization of Kalendae. For this to work, you must imstantiate on of the two objects:
- Kalendae, the widget class
- Kalendae.input, the input element popup class
Both take two parameters, a target element and a options collection. The options collection well documented on the Github page.
I put together some examples, you may find them here. THe source code is going to be of some help, if needed.
There are two examples here. The first one is just a simple trigger by class name, the other is by manual setup.