Date:<input type="text" id="datepicker">
$(function() {
    $( "#datepicker" ).datepicker({
    	dateFormat: 'dd-mm-yy',
    	beforeShowDay: checkAvailability
    	
    	});
    	})
    	 

  function checkAvailability(mydate){
 
   
    if(typeof dates == "undefined"){
   
       dates=[{"dates":"19-09-2019"},{"dates":"20-09-2019"},{"dates":"21-09-2019"},{"dates":"22-09-2019"}];
    }
  	var myBadDates = dates;
  					  
  			var $return=true;
  			var $returnclass ="available";
  			$checkdate = $.datepicker.formatDate('dd-mm-yy', mydate);
  			
                                
  			for(var x in myBadDates)
  			 {  
            console.log(x);
                  if(myBadDates[x].dates == $checkdate){
          					$return=false;
          					$returnclass="unavailable";
        					}
				   
          
          }                  
          
                            

  			return [$return,$returnclass];
  }

External CSS

  1. https://code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css

External JavaScript

  1. https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js
  2. https://code.jquery.com/ui/1.11.4/jquery-ui.js