how can i show or display only years in JQuery UI Calendar? I need to do a dropdown list with years without taking care the month, just years.
Thanks in advance
$( "#datepicker" ).datepicker({
changeMonth: false,
changeYear: true
});
http://jqueryui.com/demos/datepicker/#dropdown-month-year
Alternatively, if you just want a list of years, you can generate it without jQueryUI:
var i,yr,now = new Date();
for (i=0; i<10; i++) {
yr = now.getFullYear()+i; // or whatever
$('#select-year').append($('<option/>').val(yr).text(yr));
};
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With