jquery ui datepicker - max date
I have found out that i need to be able to offer a date in the future but it can only be one Sunday ahead of the current date. Right now my code only allows for selecting Sundays and no dates in the future. But I do need to have it so that I could select the upcoming Sunday. Is this possible with the code I have?
var fullDate = new Date();
var twoDigitMonth = ((fullDate.getMonth().length+1) === 1)? (fullDate.getMonth()+1) : '0' + (fullDate.getMonth()+1);
$('#startdate').datepicker({
maxDate: twoDigitMonth + "/" + fullDate.getDate() + "/" + fullDate.getFullYear(),
beforeShowDay:开发者_如何转开发 disableSpecificWeekDays
});
function disableSpecificWeekDays(date) {
if(date.getDay()==0){
return [true];
}else{
return [false];
}
}
精彩评论