Xin Calendar Mods

Copyright 2003 Xin Yang

Mod:Special Days
Script:mod_days.js
Description:enables different colors for special days

Core: - In-Page

Interface: - setLoopWeek()
- setLoopYear()

Usage: - setLoopWeek("fcolor", "bgcolor", start, step, "day") ... where fcolor and bgcolor specify the font color and background color, start could be 1 or 2 which means to start from the first week or the second week, and step could be 1 or 2 as well which means to repeat every week or every other week. Day could be one of the week day titles, either full or in short, and you can specify more than one week day in the call, for example:

setLoopWeek("#ffffff", "#336699", 2, 2, "Friday", "Sat");

You can repeat the setLoopWeek() call if you want different colors for different week days.


- setLoopYear("fcolor", "bgcolor", format, "date") ... where fcolor and bgcolor specify the font color and background color, format is like the date format but without the year tag, date is the month/day string and you can specify more than one date in the call.

You can repeat the setLoopYear() call if you want different colors for different dates.


include the mod script after the core script include line and before the config script include line:

<script language="javascript" src="mod_days.js"<>/script>

Demo: <script language="javascript" src="cal_core.js"<>/script>
<script language="javascript" src="mod_days.js"<>/script>

<script language="javascript">
addCalendar("date", "date", "", "", "cal-1", "cal-2", 0, 0);
setLoopWeek("#ffffff", "#336699", 1, 1, "Friday");
setLoopWeek("#ffffff", "#cc9999", 1, 1, "sat");
</script>

Note: This is a lite version core script, the setLoopYear() only works with a full version core script.