3

如何在 wijmo 日历中设置今天的最大日期?

这是我的代码:

$(function () {
    $("#calendar1").wijcalendar({
        popupMode: true,
        selectedDatesChanged: function () {
            var selDate = $(this).wijcalendar("getSelectedDate");
            var _selDate = dateFormat(selDate, "mm/dd/yyyy");
            if (!!selDate) $("#begindate").val(_selDate);
        }
    });

    $("#begindate").click(function () {
        $("#calendar1").wijcalendar("popup", {
            of: $("#begindate"),
            offset: '0 2'
        });
    })
4

2 回答 2

0

有一个 maxDate 属性:

$(".selector").wijcalendar({
 maxDate: new Date(2010,8,15)

});

链接:http ://wijmo.com/wiki/index.php/Calendar

于 2011-07-07T16:15:18.767 回答
0

得到了答案:

$(function () {
    $("#calendar1").wijcalendar({
        popupMode: true,
        maxDate: new Date(),
        selectedDatesChanged: function () {
            var selDate = $(this).wijcalendar("getSelectedDate");
            var _selDate = dateFormat(selDate, "mm/dd/yyyy");
            if (!!selDate) $("#begindate").val(_selDate);
        }
    });

    $("#begindate").click(function () {
        $("#calendar1").wijcalendar("popup", {
            of: $("#begindate"),
            maxDate: new Date(),
            offset: '0 2'
        });
    })
});
于 2011-07-11T06:27:13.480 回答