如果您正在尝试日历的开始日期和结束日期,那么这将对您有所帮助:)
`$("#from").datepicker({
format : 'dd-mm-yyyy',
endDate: '<?php echo $to; ?>',
changeMonth: false,
changeYear: false,
prevText: '<i class="fa fa-chevron-left"></i>',
nextText: '<i class="fa fa-chevron-right"></i>',
onClose: function (selectedDate) {
$("#to").datepicker("option", "startDate", selectedDate);
}
});
$("#to").datepicker({
format : 'dd-mm-yyyy',
startDate: '<?php echo $from; ?>',
changeMonth: false,
changeYear: false,
prevText: '<i class="fa fa-chevron-left"></i>',
nextText: '<i class="fa fa-chevron-right"></i>',
onClose: function (selectedDate) {
$("#from").datepicker("option", "endDate", selectedDate);
}
});`