How to get year and month of Bootstrap Datepicker as it on change
Get month:
$("#datepicker").datepicker().on('changeMonth', function(e){
var currMonth = new Date(e.date).getMonth() + 1;
});
Get year
$("#datepicker").datepicker().on('changeYear', function(e){
var currYear = String(e.date).split(" ")[3];
});