How can i disable weekends from the date picker. I have two date pickers "From" and "Till" and a "text box" for calculating the difference of the these two dates (using java script). I would also like this to reflect in the calculation.
JavaScript code for calculating the date difference
<script type="text/javascript">
$('input[name="leavePeriodFrom"], input[name="leavePeriodTo"]').change(function(){
d1 = $('input[name="leavePeriodFrom"]').datepicker('getDate');
d2 = $('input[name="leavePeriodTo"]').datepicker('getDate');
diff = 0;
if (d1 && d2) {
diff = 1+Math.floor((d2.getTime() - d1.getTime())/ 86400000); // ms per day
}
$('input[name=days]').val(diff);
document.getElementById('days').readOnly = true;
});
</script>
Hi
How can i disable weekends from the date picker. I have two date pickers "From" and "Till" and a "text box" for calculating the difference of the these two dates (using java script). I would also like this to reflect in the calculation.
JavaScript code for calculating the date difference
Many thanks in advance.
Kamran