jQuery UI DatePicker to show year only

javascript, jquery, jquery-ui

Solution

  $(function() {
    $('#datepicker1').datepicker( {
        changeMonth: true,
        changeYear: true,
        showButtonPanel: true,
        dateFormat: 'MM yy',
        onClose: function(dateText, inst) { 
            var month = $("#ui-datepicker-div .ui-datepicker-month :selected").val();
            var year = $("#ui-datepicker-div .ui-datepicker-year :selected").val();
            $(this).datepicker('setDate', new Date(year, month, 1));
        }
    });
});​

Style should be

.ui-datepicker-calendar {
    display: none;
    }​

working demo

Problem

I am using jQuery datepicker to display calender.I want to know if I can use it to Display only 'Year' and not Complete Calender ??

Original source