Almanac
In early development
HTML5 calendar element
Usage
Link almanaque.js
from your html file
<script src="path/to/almanaque.js"></script>
or require it with Browserify:
var Almanac =
almanac.createCalendar( target, options )
Create an almanac in/at target
with passed options.
Parameters:
- target HTML element: Element to replace, or embed in the almanac
- options Object
Example:
// get a HTML elementvar elem = document; // or create one and insert when you want// var elem = document.createElement( 'div' );// elem.setAttribute( 'name', 'myCalendarName') // then create a calendarvar calendar = almanac;
options
:
name
: Setsname
as input namemulti
: Sets single (input[type="radio"]) or multiple (input[type="checkbox"]) day selection.showMonths
: Months to show in calendar at onceid
: Setid
as almanac element idclasses
: Addclasses
to almanac element. Separated by spacesmonthNames
: List of month names. English names by defaultfirstDay
: A day from first month to show in almanactitle
: title for header calendarnoHeader
: Don't show almanac headerbinding
: function to launch when day is clicked. Signature: checked (bool), day data (object)start
: first enabled day (format: YYYYMMDD)end
: last enabled day (format: YYYYMMDD)
Tests
To run tests (mocha & chai):
npm install && npm test
© 2014 jacoborus
Released under MIT License