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"));


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM