Free JavaScript Event Calendar
Customizing The Look And Feel
Home
History/Background
My Enhancements
View Demos
Calendar Gallery
How It Works
Using Enhancements
Customizing Look
Contrib
Holidays & Alternate Dates
Easier Event Editing
Frequently Asked Questions
Downloads
Contact Me

How to Override the Default Configuration Settings

In addition to containing all of the source code for the "Calendar( )" and "DefineEvent( )" functions, the calendar script file defines several variables and initializes them to default values. The default values will produce a reasonably good-looking calendar, but you may wish to customize the appearance - especially the colors. By overriding these default settings before you call "Calendar( )", you can alter the appearance of the calendar to suit your tastes without having to edit the calendar script.

ORIGINAL CONFIGURATION VARIABLES
Variable Default Description
SpecialDay 1 Day of the week to highlight.  1 = Sunday (default), 2 = Monday, . . . 7 = Saturday.  To disable day-of-week highlighting, set SpecialDay=0 or SpecialDay=-1.
FontSize 5 Font size for the calendar day numbers. Can be between 1 and 7; 1 is smallest, 7 the largest.
ColorBackground "#ffffcc" Color for the background of the calendar. Hexadecimal color numbers may be used (RRGGBB) or color names (which might be implemented differently by different browsers). Be sure to enclose in quotes!
ColorSpecialDay "red" Color for highlighting the special day of the week.
ColorToday "green" Color for highlighting today's date.
ColorEvent "blue" Color for highlighting each defined event.
FirstMonth With no events defined, FirstMonth defaults to January of the current year (e.g., 200401) and LastMonth defaults to December of the current year (e.g., 200412). Each time you call "DefineEvent( )", the values are adjusted if necessary so that the range includes the month in which the event occurs. It is sometimes desirable to override the automatic values; for example, if you only have events in November 2004 and December 2004, and you don't want to include January - October, set FirstMonth=200411 (after all calls to "DefineEvent( )" are made).
LastMonth

The following are the additional configuration variables and their default values for my enhanced version which enable you to control more aspects of the your calendar's appearance without having to edit the calendar script.

NOTE

The configuration settings below with true/false values are Booleans (true or false), not strings ("true" or "false"). If you mistakenly set it to the string "false", because it has some value it will actually end up being interpreted as true.

ENHANCED CONFIGURATION VARIABLES
Variable Default Description
DateFontSize 5 Renamed the FontSize variable from the original script to better reflect its function.This is the only known incompatibility with the original script.
showAltDate false Adds display of alternate date using result from user supplied "getAltDate(dy, mo, yr, mode)" function.
showHolidays false Adds display of holidays using result from user supplied "holidays(dy, mo, yr)" function.
showAltHoly false Adds display of alternate holidays using result from user supplied "getAltHoly(dy, mo, yr)" function.
showMsgBox true Spans empty cells (before 1st day and after last) for displaying message boxes.
showMini true Adds display of minimonth of prior and/or next months if first and/or last boxes are available .
showNav true Display month navigation elements (you might choose to disable for print-friendly version).
showImages true Display event images (you might choose to disable for print-friendly version).
showLinks true Display event hyperlinks (you might choose to disable for print-friendly version).
msgBoxColor "#ffcc99" Color for the background of the message boxes.
navColor "#ffff99" Color for the background of the navigation elements.
imageAlign "left" How to align event images relative to event description text (left, right, etc.).
imageScale 100 Scale factor for event images (you might choose to scale them down on the print-friendly version).
altAlign true Alternate left/right alignment of event images on the same date for improved readability.
DefaultFormat "custom" Set to "custom" for compatibility; set to "layer" to simplify formatting for category layers.
ExportPage "" Name of html page for displaying event text for export to MS Outlook.
PrintPage "" Name of html page for displaying print-friendly format.
AltDateFormat Default: "<font color=#999999 size=2>|</font>"
Set format tags to wrap around alternate date strings in date boxes.
MonthFormat Default: "<font size=" + DateFontSize + "><b>|</b></font>"
Set format tags to wrap around month string on top of calendar.
AltMonthFormat Default: "<br><font color=#999999 size=" + DateFontSize/2 + ">|</font>"
Set format tags to wrap around alternate month string on top of calendar.
HolidayFormat Default: "<font color=#999999 size=2><b><center>|</center></b></font>"
Set format tags to wrap around holiday strings in date boxes retrieved from user-supplied "holidays()" function.
AltHolyFormat Default: "<font size=2><b><center>|</center></b></font>"
Set format tags to wrap around alternate holiday strings in date boxes retrieved from user-supplied "getAltHoly()" function.
MsgBoxFormat Default: "<font size=2>|</font>"
Set format tags to wrap around message boxes.
DefaultLayerFormat Default: "<font size=2>|</font>"
Set format tags to wrap around event descriptions (unless overriden for an entire category layer by a "DefineLayer()" function call.

If you like our script, please rate it!

 

Last updated on