Try this: JSFiddle
Now you should be able to change the month and with a click on the button the datepicker will close.
The code i changed:
$('body').on('click', function (e) {
$('.popover-calendar').each(function () {
$('.popover-calendar').datepicker();
$('.popover-calendar').mousedown(function() {
$(this).datepicker('hide');
});
});
});