这是html我一直用来获取Bootstrap datetimepicker来禁用周末:
$('.datetimepicker4').datetimepicker({
format: 'dd-MM-yyyy hh:mm',
pickSeconds: false
});
$('.datetimepicker4').datetimepicker('setDate', (new Date()));
$('.datetimepicker4').datetimepicker({
daysOfWeekDisabled: [0, 6]
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<link href="http://tarruda.github.io/bootstrap-datetimepicker/assets/css/bootstrap-datetimepicker.min.css" rel="stylesheet" />
<script src="http://tarruda.github.io/bootstrap-datetimepicker/assets/js/bootstrap-datetimepicker.min.js"></script>
<div class="input-append datetimepicker4">
<input data-format="yyyy-MM-dd" type="text">
<span class="add-on"><i data-time-icon="icon-time" data-date-icon="icon-calendar"></i></span>
</div>
答案 0 :(得分:0)
daysOfWeekDisabled
我建议使用Tarruda所基于的原始DateTimePicker,Stefan Petre
以下是一个示例:Simple Bootstrap DateTimePicker