title: Ajax pass values to datetimepicker
body: <p>I'm working on a code to dynamically set daysOfWeekDisabled in a dateTimePicker using Ajax.</p>
  
  <p>I've got problem with the daysOfWeekDisabled's array. 
  <a href="http://eonasdan.github.io/bootstrap-datetimepicker/Options/#daysofweekdisabled" rel="nofollow">http://eonasdan.github.io/bootstrap-datetimepicker/Options/#daysofweekdisabled</a></p>
  
  <p>Here is the code.</p>
  
  <p>html: </p>
  
  <pre><code>&lt;div id="show-pic" class="input-group bootstrap-timepicker"&gt;
      &lt;input id="datepicker" name="delivery_time" type="text" class="form-control input-small" placeholder="Choose a delivery time"/&gt;
  &lt;/div&gt; 
  </code></pre>
  
  <p>script:</p>
  
  <pre><code>$.ajax({
      type: 'POST',
      url: '../ajax.php',
      success: function(result) {
          console.log(result);
          $('#datepicker').datetimepicker({
              format: 'DD/MM/YYYY - H:mm',
              minDate: new Date(),
              daysOfWeekDisabled: [result]
          });
      }
  });
  </code></pre>
  
  <p>ajax.php:</p>
  
  <pre><code>$week_day = array('0','6');
  $string = implode(',', $week_day);
  echo $string;
  </code></pre>
  
  <p>The console returns 0,6... great! but only Sunday is disable, 6 is ignored.</p>
  
  <p>I tried several thing like "json_encode" or the "join()" function but can't get it. </p>
  
  <p>Kindly please help. </p>
  
  <p>Thank you. </p>