这是代码:
<input type="text" class="datepicker" id="flight_start" placeholder="mm-dd-yyyy" data-date-format="mm-dd-yyyy">
...
<script src="/ui/js/jquery.js"></script>
<script src="/ui/js/bootstrap.js"></script>
<script src="/ui/js/datatables/jquery.dataTables.min.js"></script>
<script src="/ui/js/datatables/DT_bootstrap.js"></script>
<script src="/ui/js/responsive-tables/responsive-tables.js"></script>
<script src="/ui/js/datepicker/date.js"></script>
<script src="/ui/js/datepicker/daterangepicker.js"></script>
<script src="/ui/js/chosen/chosen.jquery.js"></script>
<script src="/ui/js/bootstrap-wizard/bootstrap-wizard.js"></script>
<script src="/ui/js/sparkline/jquery.sparkline.min.js"></script>
<script src="/ui/js/datepicker/bootstrap-datepicker.js"</script>
...
<script type="text/javascript">
$('#flight_start').datepicker({
format: "mm-dd-yyyy",
startDate: "+1d"
});
</script>
格式有效,但开始日期无效。我没有收到任何错误/警告,根本不起作用。开始日期之前的日期不会以任何方式变灰,并且可以选择。我想移除这个能力。谢谢!
编辑:我也试过
$('#flight_start').datepicker('setStartDate', '+1d');
这给了我
Uncaught TypeError: Object [object Object] has no method 'setStartDate'