Paul Paul - 24 days ago 6
jQuery Question

Is it possible to get the value of startDate datetimepicker jquery?

Is there a way to get the value of startDate in bootstrap datetimepicker?.
To be specific the year of the startDate
Please help me. Thanks in advance.

$('#datepicker').datepicker({
endDate : '+4y +1m',
startDate: '-1y -10m'
});


My startDart would be 2015 because 2016 - 1year.
After setting my startDate to be 2015. Now i want to get the value of my startDate in year format. Is it possible?

Answer
        $('#datepicker').datepicker({
            endDate: '+4y +1m',
            startDate: '-1y -10m'
        });
        var startYear = $('#datepicker').data('datepicker').o.startDate.getFullYear();
        console.log(startYear);