title: Disabling jQuery UI Date Picker Dates
body: <p>I am trying to disable dates in a jQuery UI Date Picker, it works when I hard code the dates in to the variable in the JS file as follows:</p>
  
  <pre><code>var bookedDays = ["2015-3-7","2015-3-8","2015-3-15"];
  </code></pre>
  
  <p>In my PHP file I have:</p>
  
  <pre><code>&lt;?php
  $testing = "SELECT fromdate, todate FROM messages WHERE listing_id = '".$_GET['listingid']."'";
          $resulttesting = mysql_query($testing) or die(mysql_error() . "&lt;br&gt;" . $testing);
          while ($rowtesting = mysql_fetch_assoc($resulttesting)) 
  {
      $from = $rowtesting['fromdate'];
      $to = $rowtesting['todate'];
  
  }
  
  $start_time = strtotime($from);
  $end_time = strtotime($to);
  $date_list = array($from);
  
  $current_time = $start_time;
  
  while($current_time &lt; $end_time) {
      //Add one day
      $current_time += 86400;
      $date_list[] = date('Y-m-d',$current_time);
  }
  //Finally add end date to list, array contains all dates in order
  $date_list[] = $to;
  $date_list_res = '["' . implode('","', $date_list) . '"]';
  
  print_r ($date_list_res);
  
  ?&gt;
  &lt;script type="text/javascript"&gt;
      var bookedDays = &lt;?php echo json_encode($date_list_res); ?&gt;;
  &lt;/script&gt;
  </code></pre>
  
  <p>When I run a console.log in the JS file for the variable bookedDays I get ["2015-03-05","2015-03-06","2015-03-07","2015-03-08","2015-03-08"] output which is read from the database which is correct but these dates are not disabling in the date picker. Does anybody know where I'm going wrong?</p>