I found this code:
<script type="text/javascript">
var unavailableDates = ["1-9-2013", "2-9-2013", "3-9-2013", "4-9-2013", "5-9-2013"];
function unavailable(date) {
dmy = date.getDate() + "-" + (date.getMonth() + 1) + "-" + date.getFullYear();
if (jQuery.inArray(dmy, unavailableDates) == -1) {
return [true, ""];
} else {
return [false, "", "Unavailable"];
}
}
jQuery(function() {
jQuery( '#dpick' ).datepicker({
dateFormat: 'dd MM yy',
beforeShowDay: unavailable
});
});
</script>
and it seems to work fine in jsfiddle, but it won't work when I put it on my site. I added it in the header.php file just below the wp_head() call and just above the </head> tag (so it's after the JS/jQuery libraries)...I've set it to match the id on my datepicker field, but I'm still getting a JS error in console...can anyone help me out? Seems like it should be easy to get it working but I'm probably just missing some small formatting thing...