<script type="text/javascript">
$(function() {
$('#downpayment_date').datepicker({
dateFormat: 'm/d/yy', minDate: new Date(<?php echo $this->y;?>, <?php echo (($this->m) - 1);?>, <?php echo ($this->d);?>),
beforeShowDay: $.datepicker.noWeekends
});
});
</script>
Okay I have this datepicker that allows start date based on the value retrieved dynamically in PHP.
Is it possible to limit the selection of date to just two weeks from the startdate.
.i.e if the start date in the above datepicker starts from 08/12/2012, the datepicker should allow me to only select dates upto two weeks from that date.
$('#downpayment_date').datepicker({
dateFormat: 'm/d/yy', minDate: new Date(<?php echo $this->y;?>, <?php echo (($this->m) - 1);?>, <?php echo ($this->d);?>),
maxDate:new Date(<?php echo $this->y;?>, <?php echo (($this->m) - 1);?>, <?php echo ($this->d)+14;?>),
beforeShowDay: $.datepicker.noWeekends
});
Actually I found the above method bit more efficient and faster.