解决方法
$(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)); } }); });
风格应该是
.ui-datepicker-calendar { display: none; }