I need to disable multiple dates for a single month in a jQuery Datepicker. Here is my code:
<head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <script src="https://code.jquery.com/ui/1.12.0/jquery-ui.js"></script> </head> <body> <div class="input-group date"> <div class="input-group-addon"> <i class="fa fa-calendar"></i></div> <input value="" readonly="" class="form-control" name="doi" id="doi" type="text"> </div> <script type='text/javascript'> var array = ["09/14/2019","09/15/2019","09/16/2019"]; $('#doi').datepicker({ beforeShowDay: function(date){ var string = jQuery.datepicker.formatDate('mm/dd/yy', date); return [ array.indexOf(string) == -1 ] }, daysOfWeekDisabled: [0], //Disable sunday autoclose:true, }) ; </script> </body> But disabling the dates is not working.
Expected: I want to disable these dates: 09/14/2019,09/15/2019,09/16/2019 in the datepicker.