I need to highlight the dates between a start date and an end date, which I should be able to specify. Can anyone help me?
mugur, your code didn't quite work for me in Firefox or Safari, it required the date
var to be formatted (which I got from here). Here
function highlightDays(date) {
for (var i = 0; i < dates.length; i++) {
var d = date.getDate();
var m = date.getMonth();
m += 1; // JavaScript months are 0-11
var y = date.getFullYear();
var dateToCheck = (d + "/" + m + "/" + y);
if (dates[i] == dateToCheck) {
return [true, 'highlight', tips[i]];
}
}
return [true, ''];
}
And, of course, as the above function stands it doesn't account for leading-zeroes padding so the dates
array needed to be changed to:
var dates = ['22/1/2014', '23/1/2014'];