开发者

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];
}
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜