Created
September 30, 2015 01:02
-
-
Save Frithir/c85692523e64cc8904c5 to your computer and use it in GitHub Desktop.
Date picker remove dates and weekends
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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