I am using the following code to display only the years:
$(\"#datepicker\").datepicker( {viewMode: \"years\", minViewMode: \"years\"});
but inp
always year for bootstrap 3 datetimepicker https://eonasdan.github.io/bootstrap-datetimepicker/
$('#year').datetimepicker({
format: 'YYYY',
viewMode: "years",
});
$("#year").on("dp.hide", function (e) {
$('#year').datetimepicker('destroy');
$('#year').datetimepicker({
format: 'YYYY',
viewMode: "years",
});
});