An effort to create a (very) basic bootstrap 3 calendar using jQuery. It's alpha, coded in less then a day. I needed it for a project, in which it works just fine for me.
I realize it's another calendar, but I needed an inline calendar which uses the basic bootstrap 3 styling, hence the templating.
Options available when initializing plugin:
- locale: "en", the locale set in moment.js
- minDate: false, a starting date for the calendar. A moment() or MM-DD-YYYY formatted string
- maxDate: false, a maximum date for the calendar. A moment() or MM-DD-YYYY formatted string
- selectedDate: false, The initialy selected date
- startDay: 1, The starting day, 0 for Sunday, 7 for Saturday
- disabledDays: [], An array of days to hide
- dayDataCallback: false, The return of this function will be set to a 'data' variable in the day template function(date = moment())
- preRenderCallback: false, A function which is called just before showing the calendar, callback needs to be called from it to resume rendering. Use this to laod calendar data before showing it. function(month, year, callback)
- templates: {
- main:, The templates eblow get loaded in this one using the variables 'header', 'daynames' and 'days'
- header: The header template, having month, monthname and year available
- daynames: A header row to show day names, having daynames available
- daysrow: The wrapper around the days, having days -as string- available
- day: The template for one day. It has 'day' (day number), 'enabled' (false if below min or past max date), 'selected' (true if equal to selected data) and 'data' (the return from dayDataCallback) available.
- moment.js for easy date/time management
- jQueryTemplate to render the templates
- jQuery