title: Change bootstrap datepicker minViewMode by selection menu
body: <p>I'm trying to change the datepicker's minViewMode by a select menu, which has three selection: Day, Month and Year.</p>
  
  <p>What I have do:</p>
  
  <pre><code>$('#timeInterval').change(function(){
      if($(this).val() === "Month") {
          $('#datepicker-default .date').datepicker({
              format: "yyyy/mm",
              autoclose: true,
              minViewMode: "months"
          });
      } else if($(this).val() === "Year") {
          $('#datepicker-default .date').datepicker({
              format: "yyyy",
              autoclose: true,
              minViewMode: "years"
          });
      } else {
          $('#datepicker-default .date').datepicker({
              format: "yyyy/mm/dd",
              autoclose: true
          });
      }
  });
  </code></pre>
  
  <p>And the selection menu:</p>
  
  <pre><code>&lt;select class="custom-select" id="timeInterval" name="timeInterval"&gt;
      &lt;option selected="" value="0"&gt;Select to choose...&lt;/option&gt;
      &lt;option value="Year"&gt;Year&lt;/option&gt;
      &lt;option value="Month"&gt;Month&lt;/option&gt;
      &lt;option value="Day"&gt;Day&lt;/option&gt;
      &lt;option value="Hour"&gt;Hour&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>It now acts that when I choose the selection of the menu, it will initialize right and work good.
  But when I try to switch (e.g. from Month to Year), it doesn't work, still work on minViewMode = months (or whatever I first chose).</p>
  
  <p>Any idea will be appreciated.</p>