Is there a way to give a class to the first 17 days on a jquery datepicker calendar?
I have tried this but it just seems to add the class to every day...
beforeShowDay: function(date) {
for (i = 0; i < 17; i++) {
return [true, 'myClass'];
}
return [false, ''];
}
EDIT:
I've managed to nearly get it with the following code:
beforeShowDay: function (date) {
if (date <= new Date().setDate(new Date().getDate()+17) && date >= new Date() ) {
return [true, 'myClass'];
}
return [true, ''];
}
The only problem is that it doesn't give the class to todays date. Any ideas why?