我知道这听起来很疯狂,但我需要允许在这里选择禁用日期: https ://eonasdan.github.io/bootstrap-datetimepicker/
为什么?我需要为预订可能性较小的日期涂上颜色,并在预订可能性较大的地方涂上绿色日期,所以我写道:
<script>
$(function () {
$('#start').datetimepicker({
format: 'YYYY/MM/DD',
enabledDates: [
moment("05/21/2016"),
moment("05/22/2016"),
moment("05/23/2016"),
moment("05/24/2016"),
],
});
});
</script>
<style type="text/css">
.bootstrap-datetimepicker-widget table th.disabled,
.bootstrap-datetimepicker-widget table th.disabled:hover {
background: #FF9088 !!important;
border-radius: 0px !important;
color: #fff !important;
border: 1px solid #fff !important;
}
.bootstrap-datetimepicker-widget table td.disabled,
.bootstrap-datetimepicker-widget table td.disabled:hover {
background: #FF9088 !important;
border-radius: 0px !important;
border: 1px solid #fff !important;
color: #fff !important;
}
.bootstrap-datetimepicker-widget table td span.disabled,
.bootstrap-datetimepicker-widget table td span.disabled:hover {
background: #FF9088 !important;
border-radius: 0px !important;
border: 1px solid #fff !important;
color: #fff !important;
}
.day {
background: rgba(88, 204, 0, 0.52) !important;
border-radius: 0px !important;
border: 1px solid #fff !important;
}
</style>
如您所见,我已启用绿色日期,其他日期已禁用且其为红色...但我需要允许访问者也选择禁用日期,而不仅仅是启用...
我使用启用和禁用只是为日历上的日期着色......
那么如何允许选择禁用日期呢?