Piet,
I think I have it.
In the datepick settings, change onDate: nationalDays to onSelect: nationalDays .
Then nationalDays should be as follows:
function nationalDays(dates) {
var natDate;
var includesNatDate = false;
for (i=0; i<natDays.length; i++) {
d = $.datepick.newDate(natDays[i][2], natDays[i][0], natDays[i][1]);
if(d.getTime() >= dates[0].getTime() && d.getTime() <= dates[1].getTime()) {
includesNatDate = true;
break;
}
}
$("#message").html('includesNatDate : ' + includesNatDate);
} In the last line, I just display a true|false message but you will do whatever is necessary in your application. There's no point returning true|false from nationalDays because it is a callBack function and you don't have access to the returned value.
Hope this helps.Airshow
Airshow
WiFi Lounge Lizard
Moderator
2,683 posts since Apr 2009
Reputation Points: 321
Solved Threads: 372