Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save mclarenmervin/834e3dfd3a721734aedd63d29a315592 to your computer and use it in GitHub Desktop.
Save mclarenmervin/834e3dfd3a721734aedd63d29a315592 to your computer and use it in GitHub Desktop.
jQuery(document).ready(function($){
var unavailableDates = ["9-3-2012", "14-3-2012", "15-3-2012"];
function unavailable(date) {
dmy = date.getDate() + "-" + (date.getMonth() + 1) + "-" + date.getFullYear();
if ($.inArray(dmy, unavailableDates) == -1) {
return [true, ""];
} else {
return [false, "", "Unavailable"];
}
}
$(function() {
$("#iDate").datepicker({
dateFormat: 'dd MM yy',
beforeShowDay: unavailable
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment