Event close on click of the Boostrap datepicker

1

Using jQueryUI's datepicker by default the click event on the date and datepicker close works.

How can I do this in the bootstrap datepicker ?

JS:

$('#data').datepicker({
  format: 'dd/mm/yyyy',
  language: 'pt-BR',
});

HTML:

<input id="data" class="form-control text-center" type="text">
    
asked by anonymous 01.02.2015 / 03:43

1 answer

1

To close the datepicker automatically when you select the date you can use the initialize plugin with the autoclose option.

$('#data').datepicker({
  format: 'dd/mm/yyyy',
  language: 'pt-BR',
  autoclose: true
});
    
01.02.2015 / 03:54