title: yii2 datepicker disable dates using javascript
body: <p>I rewrited my question:</p>
  
  <p>I'm using <a href="https://github.com/kartik-v/yii2-widget-datepicker" rel="noreferrer">Kartick DatePicker</a> to display a datepicker. On this datepicker, I want to disable dates using javascript. Here is what I have:</p>
  
  <pre><code>&lt;?= DatePicker::widget([
      'name' =&gt; 'mydate',
            'language' =&gt; 'fr',
            'clientOptions' =&gt; [
                'autoclose' =&gt; true,
                'format' =&gt; 'dd-M-yyyy'
            ]
    ]);?&gt;
  </code></pre>
  
  <p>With the JS:</p>
  
  <pre><code> $(function(){
       $("#w0").datepicker("setDatesDisabled", ['25-08-2017']);
  });
  </code></pre>
  
  <p>I tried to change the format of the date to <code>2017/08/25</code> or <code>08/25/2017</code> but in any case nothing is displayed into the logs.</p>
  
  <p>I also tried to use <code>kvDatepicker()</code> instead of <code>datepicker()</code> but this gave me</p>
  
  <blockquote>
    <p>Uncaught TypeError: $(...).kvDatepicker is not a function</p>
  </blockquote>
  
  <p>Any clue on what is wrong here? Thank's.</p>