Click here to Skip to main content
15,921,959 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I was wondering about this calendar javascript:
http://www.javascriptkit.com/script/script2/eventscalendar.shtml[^]

When today's date is the same as the yellow highlighted date, is it possible to have another color than the green (date today) and yellow (activity)?
Posted

In the zip package you would need to edit the html file on line 142. The code snippet below pasted at line 142 should render the result you are looking for.

if ((todaysDay == x) && (todaysDate == daycounter) && (todaysMonth == monthNum)) {
	//add this if statement to check and see if it is an event today
    if (checkevents(daycounter,monthNum,yearNum,i,x))
    {
	// if true make the bgcolor what ever color you like other than green or yellow
	calendarString += '<td align=\"center\" bgcolor=\"#9A45EE\" height=\"30\" width=\"40\"><a href=\"javascript:showevents(' + daycounter + ',' + monthNum + ',' + yearNum + ',' + i + ',' + x + ')\">' + daycounter + '<\/a><\/td>';
    }
    else
    {
	calendarString += '<td align=\"center\" bgcolor=\"#AAFFAA\" height=\"30\" width=\"40\"><a href=\"javascript:showevents(' + daycounter + ',' + monthNum + ',' + yearNum + ',' + i + ',' + x + ')\">' + daycounter + '<\/a><\/td>';
    }
}
else	calendarString += '<td align=\"center\" bgcolor=\"#FFFFC8\" height=\"30\" width=\"40\"><a href=\"javascript:showevents(' + daycounter + ',' + monthNum + ',' + yearNum + ',' + i + ',' + x + ')\">' + daycounter + '<\/a><\/td>';
}
 
Share this answer
 
Wow, works like a charm!
I am truly grateful! :-D
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900