easyUI日期框,默认显示今天,今天以后的日期不能选

<input class="easyui-datebox" id="chartDate"/>

js:

var curr_time = new Date();
//今天以后的日期不能选
$('#chartDate').datebox().datebox('calendar').calendar({
    validator: function(date){
        var d1 = new Date(curr_time.getFullYear(), curr_time.getMonth(), curr_time.getDate());
        return d1>=date;
    }
});
//日期默认为今天
$("#chartDate").datebox("setValue",curr_time.Format("yyyy-MM-dd"));
posted @ 2020-01-03 16:34  后知后觉0107  阅读(1230)  评论(0编辑  收藏  举报