wijmo日期选择器最大日期

时间:2011-07-07 05:28:26

标签: jquery asp.net-mvc-2 wijmo

如何在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'
        });
    })

2 个答案:

答案 0 :(得分:0)

有一个maxDate属性:

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

});

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

答案 1 :(得分: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'
        });
    })
});