I need to set the default month and the year for the jquery monthpicker when page loads.
Below is my code. Currently monthpicker text box is empty when loads.
$(document).ready(function() {
$('#monthPicker').datepicker( {
changeMonth: true,
changeYear: true,
showButtonPanel: 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));
}
});
});
And also, I need to remove the dates from the calendar, I mean I just only need to display the year and month selection options.