ActiveWeek: Integer. Current selected week. Defaults to the selected week in the querystring.
ActiveMonth: Integer. Current selected month. Defaults to the selected month in the querystring.
ActiveYear: Integer. Current selected year. Defaults to the selected year in the querystring.
HighlightWeek: Boolean. Set to true to highlight current week. Defaults to false.
HighlightDayspan: Integer. Set to a date constant (vbMonday, vbTuesday etc) to highlight that day. Defaults to 0.
TargetPage: String. Set to the url to which the links will redirect. Defaults to an empty string.
QueryString: String. Set to any extra you want to add to the querystring. Start it with a &. Defaults to an empty string.
Text: cls_CBCalendar_Text. Text information for the calendar.
AddHightlight: Sub(dHighlight). Adds a date to be highlighted.
DrawCalendar: Sub(). Draws the calendar using the specified settings.
Interface cls_CBCalendar_Text
Monday. String. Set to whatever string you want to representate Monday. Defaults to the session locale.
Tuesday. String. Set to whatever string you want to representate Tuesday. Defaults to the session locale.
Wednesday. String. Set to whatever string you want to representate Wednesday. Defaults to the session locale.
Thursday. String. Set to whatever string you want to representate Thursday. Defaults to the session locale.
Friday. String. Set to whatever string you want to representate Friday. Defaults to the session locale.
Saturday. String. Set to whatever string you want to representate Saturday. Defaults to the session locale.
Sunday. String. Set to whatever string you want to representate Sunday. Defaults to the session locale.
January. String. Set to whatever string you want to representate January. Defaults to the session locale.
February. String. Set to whatever string you want to representate February. Defaults to the session locale.
March. String. Set to whatever string you want to representate March. Defaults to the session locale.
April. String. Set to whatever string you want to representate April. Defaults to the session locale.
May. String. Set to whatever string you want to representate May. Defaults to the session locale.
June. String. Set to whatever string you want to representate June. Defaults to the session locale.
July. String. Set to whatever string you want to representate July. Defaults to the session locale.
August. String. Set to whatever string you want to representate August. Defaults to the session locale.
September. String. Set to whatever string you want to representate September. Defaults to the session locale.
October. String. Set to whatever string you want to representate October. Defaults to the session locale.
November. String. Set to whatever string you want to representate November. Defaults to the session locale.
December. String. Set to whatever string you want to representate December. Defaults to the session locale.
NextMonth. String. Set to the text to be used as title attribute on the "Next Month" link. Defaults to the session locale.
PreviousMonth. String. Set to the text to be used as title attribute on the "Previous Month" link. Defaults to the session locale.
Summary. String. Set to the text to be used as summary attribute on the table. Supports some predefined contants described below. Defaults to "Calendar showing [MONTHNAME] ([MONTH]) [YEAR]".
Caption. String. Set to the text to be used as caption on the table. Supports some predefined contants described below. Defaults to an empty string.
Contants for cls_CBCalendar_Text.Summary
[MONTH]. Replaced with the currently selected month.
[MONTHNAME]. Replaced with the name of the currently selected year.
[YEAR]. Replaced with the currently selected year.
CSS classes to use
table.calendar_table
td.calendar_navigation
th.calendar_header
tr.calendar_highlightweek
td.calendar_highlightday
td.calendar_highlightdayspan
td.calendar_normal
Examples
Quick description of this script. First we include the cls_CBCalendar.asp file to get access to the class. Then we declare it and set it to a new instance of the class.
Next we add two dates to be highlighted. The one clicked on (from the querystring) and then we add the date after tomorrow.
After adding those dates we tell the class to highlight the Monday column in the calendar.
Right before rendering the calendar we set the caption text. Then we call the DrawCalendar method to draw it.
Finally, we destroy the Calendar class for optimal performance.
After the script is done, we include the example stylesheet. This should really be put in the <head></head> section of a page but my example doesn't have one.
Example of a cascading stylesheet to be used with the calendar.