Skip to content

Instantly share code, notes, and snippets.

@hugodias
Created March 7, 2013 12:38
Show Gist options
  • Save hugodias/5107754 to your computer and use it in GitHub Desktop.
Save hugodias/5107754 to your computer and use it in GitHub Desktop.
Specific days datepicker
var availableDates = ["9-5-2011","14-5-2011","15-5-2011"];
function available(date) {
dmy = date.getDate() + "-" + (date.getMonth()+1) + "-" + date.getFullYear();
console.log(dmy+' : '+($.inArray(dmy, availableDates)));
if ($.inArray(dmy, availableDates) != -1) {
return [true, "","Available"];
} else {
return [false,"","unAvailable"];
}
}
$('#date').datepicker({ beforeShowDay: available });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment