day-schedule-selector
day-schedule-selector copied to clipboard
Add Clear selections
I added a function in index.js to clear the selcted time-slots. You could add it to the git.
/**
* Clear the selections
* @public
*/
DayScheduleSelector.prototype.clear = function () {
var plugin = this
$.each(this.options.days, function (_, v) {
plugin.$el.find(".time-slot[data-day='" + v + "']").each(function () {
if (isSlotSelected($(this))) {
plugin.deselect($(this));
}
});
})
};
To run it, call
$("#day-schedule").data('artsy.dayScheduleSelector').clear();