$('#Datepicker').datepicker({
    changeMonth: true,
    changeYear: true,
    dateFormat: 'yy-MM',
    showButtonPanel: true,
    onClose: function(dateText, inst) {
    var month = $("#ui-datepicker-div .ui-datepicker-month option:selected").val();//得到选中的月份值
    var year = $("#ui-datepicker-div .ui-datepicker-year option:selected").val();//得到选中的年份值
    $(this).val(year+'-'+(parseInt(month)+1));//给input赋值,其中要对月值加1才是实际的月份
     }
});           
<style type="text/css">
//隐藏日的显示div
.ui-datepicker-calendar{display: none; }
</style>
<body>
Date:  <input  id="Datepicker" type="text"/>
</body>

转自:http://wan1989quan09.blog.163.com/blog/static/896324042013227103156523/