bootstrap datepicker只能选择小于今天的日期

1、html代码

        
class="date-picker pull-left">
"datepicker">
class="input-group pull-left"> class="input-group-addon left-addon"> "~/assets/img/datepicker-icon.png"> "text" id="dp" name="dp" placeholder="加入开始日" value="" class="date-input"> class="input-group-addon right-addon">class="fa fa-angle-down">
class="input-group pull-left" style="margin-left: 30px;"> class="input-group-addon left-addon"> "~/assets/img/datepicker-icon.png"> "text" id="end" name="end" placeholder="加入结束日" value="" class="date-input"> class="input-group-addon right-addon">class="fa fa-angle-down">

2、js代码

$('#dp').datepicker({
    todayBtn: "linked",
    autoclose: true,
    todayHighlight: true,
    endDate: new Date()
});
$('#end').datepicker({
    todayBtn: "linked",
    autoclose: true,
    todayHighlight: true,
    endDate: new Date()
});

 

转载于:https://www.cnblogs.com/xinbaba/p/7955225.html

你可能感兴趣的:(bootstrap datepicker只能选择小于今天的日期)