I am using the following code to display only the years:
$(\"#datepicker\").datepicker( {viewMode: \"years\", minViewMode: \"years\"});
but inp
Try this
$("#datepicker").datepicker({ format: "yyyy", viewMode: "years", minViewMode: "years" });
$("#datepicker").datepicker( { format: " yyyy", // Notice the Extra space at the beginning viewMode: "years", minViewMode: "years" });