I'm unable to get the date to equal my string in my Jquery Datepicker
var currDay = date.getDate();
var currMonth = date.getMonth();
var currYear = date.getFullYear();
var fullDate = currMonth + '/' + currDay + '/' + currYear;
fullDate = fullDate.toString();
if(fullDate == special_dates[b][4]){
开发者_如何转开发 return[false];
}
I'm using the jquery ui datepicker. special_dates is my array with the date as a string like 12/30/2010
fullDate and special_dates are working when I alert it, so I'm not sure what im doing wrong.
It might be as simple as this. return[false];
looks wrong. Try changing this:
if(fullDate == special_dates[b][4]){
return[false];
}
to
if(fullDate == special_dates[b][4]){
return false;
}
or better yet (if there is no other logic needed):
return fullDate == special_dates[b][4];
精彩评论