title: How to get current viewMode property from "Bootstrap Datepicker"
body: <p>How to get current <code>viewMode</code> property from "Bootstrap Datepicker"?
  I initialize the control with <code>viewMode= 'years'</code>  and I want to close datepicker on <code>changeDate</code> event, only when <code>viewMode='days'</code>.</p>
  
  <p>The user selects a year, then a month, and finally a day. In that moment the control must  be closed.</p>
  
  <p>This is the code:</p>
  
  <pre><code>$("#date").datepicker(
      {viewMode: 'years',
       format: 'dd/mm/yyyy'
  });
  
  $('#date').on('changeDate', function (ev) {
      //close when viewMode='0' (days)
  })
  </code></pre>
  
  <p>Can anyone help?</p>