$('.datepicker').datepicker().on('changeDate', function(ev) {
// YOUR CODE
}).on('hide', function(event) {
event.preventDefault();
event.stopPropagation();
});
<style type="text/css">
.ui-datepicker
{
z-index: 1001 !important; /* must be > than popup editor (1000) */
}
</style>
$('#fecha_nac').datepicker({
format: 'dd-mm-yyyy',
autoclose: true,
language: 'es'
}).on('hide', function(e) {
e.stopPropagation();
});