Module: Calendar

Webguru Calendar Module
Author:
Source:
Examples
//Instantiating Calendar Object
var twoCalendars = new Calendar('#calendars', {format: 'DD-MM-YY'});
//Render event (using: MomentJS)
var today = moment(new Date());

twoCalendars.onRender(function(date) {
	if (today.isAfter(date.unparsed))
		return {disabled : true, class_name : 'date-history'};

	return {};
});
//Initializing the calendar
twoCalendars.initialise(new Date());

Classes

Calendar

Members

(static) config :Object

Configuration before instantiation
Type:
  • Object
Source:

Methods

(inner) clear() → {*}

Clear multiple selection
Source:
Returns:
Type
*

(inner) destroy() → {*}

Destroy calendar
Source:
Returns:
Type
*

(inner) followMouse(beforeClass, afterClass, hoverClass, selector) → {boolean}

Paint dates on mouse follow
Parameters:
Name Type Description
beforeClass
afterClass
hoverClass
selector
Source:
Returns:
Type
boolean

(inner) formatDate(date, format) → {*}

Format a date
Parameters:
Name Type Description
date Date | String Date to format
format String Date format to format to
Source:
Returns:
Type
*

(inner) getDates() → {*}

Get Dates
Source:
Returns:
Type
*

(inner) getFormat(name) → {*}

Get a format from the pre-configured or the default format of the calendar
Parameters:
Name Type Description
name String Format Name
Source:
Returns:
Type
*

(inner) getState() → {object}

Get state
Source:
Returns:
Type
object

(inner) hide(options) → {boolean}

Show calendar, Checkout jQuery slideToggle documentation for better utilization.
default mode: which uses jQuery slideToggle() function.
'instant' mode: which uses the standard jQuery hide() function.
Parameters:
Name Type Description
options Object jQuery slideToggle options
Source:
Returns:
Type
boolean

(inner) hoverPaint(hoverClass, positionClass, siblingsFn) → {function}

Paint a date button onHover
Parameters:
Name Type Description
hoverClass
positionClass
siblingsFn
Source:
Returns:
Type
function

(inner) initialise(dates, min)

Initialise Claendar
Parameters:
Name Type Description
dates
min
Source:

(inner) isHidden() → {boolean}

Check if the calendar is hidden.
Source:
Returns:
Type
boolean

(inner) moveTo(to, properties, options)

Move the calendar to an Element position or to a specified number
Parameters:
Name Type Description
to Number | String | Element | jQuery Destination could be a number or an Element
properties Object jQuery Animate properties
options Object jQuery Animate options
Source:

(inner) next() → {*}

Go to next month
Source:
Returns:
Type
*

(inner) onChange(callback) → {boolean}

Triggered at date change.
Parameters:
Name Type Description
callback function
Source:
Returns:
Type
boolean

(inner) onFill(callback) → {boolean}

Triggered after filling of PickMeUp container with new markup of days, months, years. May be needed for inner datepicker markup editing.
Parameters:
Name Type Description
callback function
Source:
Returns:
Type
boolean

(inner) onHide(callback) → {boolean}

Triggered at hiding.
Parameters:
Name Type Description
callback function
Source:
Returns:
Type
boolean

(inner) onRender(callback) → {boolean}

Executed for each day element rendering, takes date argument, allows to select, disable or add class to element
Parameters:
Name Type Description
callback function
Source:
Returns:
Type
boolean

(inner) onShow(callback) → {boolean}

Triggered at showing.
Parameters:
Name Type Description
callback function
Source:
Returns:
Type
boolean

(inner) parse() → {date|Moment}

Parse a date with MomentJS
Source:
Returns:
Type
date | Moment

(inner) prev() → {*}

Go to previous month
Source:
Returns:
Type
*

(inner) requestDates(url, params, callback) → {boolean}

Ajax request
Parameters:
Name Type Description
url
params
callback
Source:
Returns:
Type
boolean

(inner) resetPosition(selector) → {boolean}

Reset calendar position
Parameters:
Name Type Description
selector
Source:
Returns:
Type
boolean

(inner) setCloseBtn(selector, options) → {boolean}

Set an element as a close button for the Calendar
Parameters:
Name Type Description
selector String | Element | jQuery
options Object
Source:
Returns:
Type
boolean

(inner) setDate(date) → {*}

Set Date
Parameters:
Name Type Description
date Date | String
Source:
Returns:
Type
*

(inner) setFormat(name) → {boolean}

Set a format from the pre-configured formats as default to the Calendar
Parameters:
Name Type Description
name String Format Name
Source:
Returns:
Type
boolean

(inner) setOpenBtn(selector, options) → {boolean}

Set an element as an open button for the Calendar
Parameters:
Name Type Description
selector String | Element | jQuery
options Object
Source:
Returns:
Type
boolean

(inner) setState() → {boolean}

Set state
Source:
Returns:
Type
boolean

(inner) show(options) → {boolean}

Show calendar, Checkout jQuery slideToggle documentation for better utilization.
default mode: which uses jQuery slideToggle() function.
'instant' mode: which uses the standard jQuery show() function.
Parameters:
Name Type Description
options Object jQuery slideToggle options
Source:
Returns:
Type
boolean

(inner) toggle(options)

Toggle calendar, Checkout jQuery slideToggle documentation for better utilization.
Parameters:
Name Type Description
options Object jQuery slideToggle options api
Source:

(inner) update() → {*}

Update calendar
Source:
Returns:
Type
*