Hi,
I want to use 2 datepicker controls, but when the user selects the first date, I want this date to be the minimum date for the second one. For some reason this code is not working. Can anybody see what I am doing wrong?
<script type="text/javascript" >
$(document).ready(function(){
$("#inputdate").datepicker({
dateFormat: 'dd/mm/yy',
beforeShowDay: function(date) {
var a = new Array();
a[0] = date.getDay() == 0;
a[1] = '';
a[2] = '';
return a;
},
onSelect:function(date) {
$("#inputdate2").datepicker('option','minDate',new Date(date))
}
});
$("#inputdate2").datepicker({
dateFormat: 'dd/mm/yy',
beforeShowDay: function(date) {
var a = new Array();
a[0] = date.getDay() == 0;
a[1] = '';
a[2] = '';
return a;
}
});
});
</script>
Thanks in advance.