title: bootstrap datepicker ... how to change options?
body: <p>I am using bootstrap datepicker and initiate him like this</p>
  
  <pre><code>        &lt;input class="form-control datepicker" id="sel3"&gt;
  
          $(".datepicker").datepicker({
              format: " dd-mm-yyyy",
              startView: "days",
              minViewMode: "days"
          });
  </code></pre>
  
  <p>I have an input-field to input a date. But I want to be able to switch between "you can select the full date dd-mm-yyyy" and "you can only select the year yyyy". I already figured out that I can set the startView to year ... but I cannot change it to day to select the full date.</p>
  
  <p>I tried this but I failed.</p>
  
  <pre><code>if(something){
          $(".datepicker").datepicker({
              format: " dd-mm-yyyy",
              startView: "days",
              minViewMode: "days"
          });
   }else {
          $(".datepicker").datepicker({
              format: " yyyy",
              startView: "years",
              minViewMode: "years"
          });
   }
  </code></pre>