I need help... I have a datepicker where you are only allowed to choose weekends, the problem is that after noon on the thursday you may no longer choose the upcoming saturday or sunday. The script i have below with 36 hour check works for saturday but you can still choose sunday. Can anyone help me with this?
var chosenDate = this.val();
var minDate = new Date();
minDate.setHours(minDate.getHours()+36);
if(Date.parse(chosenDate) < Date.parse(minDate)){
this.valid(false,"error message");
return;
}
if (this.val().getDay() !== 0 && this.val().getDay() != 6 ) {
this.valid(false,"error message");
return;
}
this.valid(true);