Skip to content

Instantly share code, notes, and snippets.

@crishnakh
Created January 11, 2013 08:31
Show Gist options
  • Save crishnakh/4508952 to your computer and use it in GitHub Desktop.
Save crishnakh/4508952 to your computer and use it in GitHub Desktop.
<script type="text/javascript">
var unavailableDates = ["11-1-2013","12-1-2013","13-1-2013"];
function unavailable(date) {
dmy = date.getDate() + "-" + (date.getMonth()+1) + "-" + date.getFullYear();
if ($.inArray(dmy, unavailableDates) < 0) {
return [true,"","Book Now"];
} else {
return [false,"","Booked Out"];
}
}
</script>
<input type="datetime" name="id" id="id" placeholder="YYYY/MM/DD">
<script type="text/javascript">
$('#id').datepicker({dateFormat: 'YYY/MM/DD', changeMonth: true, changeYear: true, yearRange: '+0:+0',beforeShowDay: unavailable});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment