【发布时间】:2015-10-27 10:35:04
【问题描述】:
我想使用 jquery UI datepicker 作为月份选择器。它的代码是什么?这里我试过了,但没有成功
$('#startDateTotal').datepicker({
changeMonth: true,
changeYear: true,
showButtonPanel: true,
dateFormat: 'yy-MM ',
maxDate: 0,
onClose: function (selectedDate) {
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));
$("#endDateTotal").datepicker("option", "minDate", selectedDate);
}
【问题讨论】:
标签: javascript jquery jquery-ui datepicker