-
Notifications
You must be signed in to change notification settings - Fork 53
Documentation
PIGNOSE edited this page Aug 19, 2017
·
30 revisions
You can use calendar plugin to insert single line, Easy
.
$('.calendar').pignoseCalendar();
You can set initialize date to giving
date
option.
// This calendar is starting date to '2017-09-01'.
$('.calendar').pignoseCalendar({
date: moment('2017-09-01')
});
The default event to catch date changes.
$('.calendar').pignoseCalendar({
select: function(date, context) {
/**
* @params date moment[]
* @params context PignoseCalendarContext
*/
// You can get target element in `context` variable, This element is same `$(this)`.
var $element = context.element;
// You can also get calendar element, It is calendar view DOM.
var $calendar = context.calendar;
// Selected dates (start date, end date) is passed at first parameter, And this parameters are moment type.
// If you unselected date, It will be `null`.
console.log(date[0], date[1]);
}
});