Skip to content

Instantly share code, notes, and snippets.

@Frithir
Created September 30, 2015 01:02
Show Gist options
  • Save Frithir/c85692523e64cc8904c5 to your computer and use it in GitHub Desktop.
Save Frithir/c85692523e64cc8904c5 to your computer and use it in GitHub Desktop.
Date picker remove dates and weekends
var holidays= ["2014-7-30","2015-07-29","2013-03-16"]
$('input').datepicker({
beforeShowDay: function(date){
var string = jQuery.datepicker.formatDate('yy-mm-dd', date);
var noWeekend = $.datepicker.noWeekends(date);
if (noWeekend[0]) {
return [$.inArray(string, holidays) == -1];
}
else
return noWeekend;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment