Skip to content

Instantly share code, notes, and snippets.

@djpate
Forked from nareshsangana/gist:6387027
Last active December 22, 2015 00:09
Show Gist options
  • Save djpate/6387031 to your computer and use it in GitHub Desktop.
Save djpate/6387031 to your computer and use it in GitHub Desktop.
<html lang="en">
<head>
<meta charset="utf-8" />
<title>jQuery UI Datepicker - Default functionality</title>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<link rel="stylesheet" href="/resources/demos/style.css" />
<script>
disabled_days = ["8-30-2013","9-11-2013","9-10-2013"];
$(document).ready(function(){
$('#calendar').datepicker({
beforeShowDay: function(date){
var m = date.getMonth()+1, d = date.getDate(), y = date.getFullYear();
var day_string = m+"-"+d+"-"+y;
for(i=0;i<=disabled_days.length;i++){
if(disabled_days[i] == day_string){
return [false];
}
}
return [true];
}
});
});
</script>
</head>
<body>
<p>Date: <input type='text' id='calendar'></p>
</body>
</html><php ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment