Skip to content

Instantly share code, notes, and snippets.

Created February 21, 2016 12:05
Show Gist options
  • Save anonymous/d4db3993a773629f97f8 to your computer and use it in GitHub Desktop.
Save anonymous/d4db3993a773629f97f8 to your computer and use it in GitHub Desktop.
beforeShowDay: function(date) {
var enabled = true;
disabledDates.forEach(function(disabledDate){
var from = new Date(disabledDate['from']);
var to = new Date(disabledDate['to']);
from.setHours(0);
from.setMinutes(0);
from.setSeconds(0);
to.setHours(23);
to.setMinutes(59);
to.setSeconds(59);
if (date < from || date > to) {
enabled = true;
} else {
enabled = false;
}
});
return [enabled, '', ''];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment