Skip to content

Instantly share code, notes, and snippets.

@hayskytech
Created April 13, 2023 09:15
Show Gist options
  • Save hayskytech/8f40c3f150dd57781a79ba80373714bc to your computer and use it in GitHub Desktop.
Save hayskytech/8f40c3f150dd57781a79ba80373714bc to your computer and use it in GitHub Desktop.
<input type="text" />
<script type="text/javascript" src="https://code.jquery.com/jquery-3.4.1.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/jquery-ui.min.js"></script>
<link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/themes/redmond/jquery-ui.css">
<script type="text/javascript">
var array = ["2019-12-23","2013-03-15","2013-03-16"];
var dateToday = new Date();
$('input').datepicker({
// defaultDate: "+1w",
changeMonth: true,
minDate: dateToday,
beforeShowDay: function(date){
var string = jQuery.datepicker.formatDate('yy-mm-dd', date);
return [ array.indexOf(string) == -1 ]
}
});
// $('input').datepicker({ defaultDate: '+1w' });
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment