Many of the formatting enhancements I made are enabled by default, but I added
new configuration variables to allow you to enable or disable them and to control various display attributes such
as colors. This allows you to Customize the Look & Feel of your calendar without having to modify the calendar JavaScript. Anyone who has been using Kevin Ilsen's calendar script
should be able to replace it with my version without requiring any other changes. These new variables are discussed on the
How It Works page.
Techniques for including holidays and/or the corresponding
dates in another calendar system are discussed on the Holidays & Alternate Dates page.
Message Boxes
I noticed that many print calendars add message boxes in the unused date cells that usually occurs at the beginning and/or end of most months, so I added this capability to this
web calendar. These messages can be either month-specific or generic ones that apply to any month. Since the sizes of these
message areas will vary depending on which day of the week a given month begins and end on, I add the capability to specify
different messages to display based on the length of the space available.
To enable this feature, I added "showMsgBox" and "defaultMsgBox"
configuration settings and an "AddMsgBox" command. This feature is enabled by default, but you can disable
it by setting "showMsgBox = false". To define your own generic message to display in message boxes,
set "defaultMsgBox" to a string containing your message.
To define a month-specific message, use the "AddMsgBox" command.
The first argument, "yearmonth", specifies the month and year in the form "yyyymm"
and the second argument is a text string containing the message including any HTML formatting. An optional 3rd argument, "minspan",
specifies the minimum number of adjacent cells required to display that particular message. [Note: "DefaultMsgBox"
is simply a more convenient way of using the "AddMsgBox" command with a yearmonth of
0 which means every month.]
If there is unused space at the beginning of the month, it will display
the first month-specific message defined for that yearmonth that satisfies "minspan" and
mark it as shown. If there is no month-specific message, it will show a default message. If there is unused space at
the end of the month, it will repeat this process beginning with the first un-shown month-specific message defined for
that yearmonth. Depending on the arguments you supply, what gets displayed will vary based on what day of
the week the month begins or ends on. For example:
AddMsgBox(200310,"Long
message",3);
AddMsgBox(200310,"Short message");
would
result in "Short message" at the top because October 2003 began on a Wednesday and ended on a Friday. In
a different month both, either, or neither of these messages might be displayed on the calendar.
By having different "AddMsgBox" commands for the regular and printer-friendly html pages, you could
specify one set of messages for the web calendar, while turning off display of the navigation features and specifying another
set of messages for the printer-friendly version.