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