我有两个问题:
按钮“今天”不起作用,因为日历未使用所选值初始化,并初始化当前月份。
我需要为按钮“完成”覆盖 onclick - 怎么做?
脚本:
$('.datefield_month').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).val($.datepicker.formatDate('MM, yy', new Date(year, month, 1)));
}
});
看法:
<input name = "Month" class = "datefield_month" value="@Model.Month.ToString("Y", Session["culture"] as CultureInfo)" type="text" id ="Month" />