Dates with shows scheduled are highlighted in orange. Click each date to see the show details. <% If Request.QueryString = "a" Then %> You are currently viewing the entire calendar year. To view only the next 3 months, click here. <% Else %> You are currently viewing the next 3 months. To view the entire calendar year, click here. <% End If %> You may also switch to a list view.

<% ' ***Begin Function Declaration*** ' New and improved GetDaysInMonth implementation. ' Thanks to Florent Renucci for pointing out that I ' could easily use the same method I used for the ' revised GetWeekdayMonthStartsOn function. Function GetDaysInMonth(iMonth, iYear) Dim dTemp dTemp = DateAdd("d", -1, DateSerial(iYear, iMonth + 1, 1)) GetDaysInMonth = Day(dTemp) End Function Function GetWeekdayMonthStartsOn(dAnyDayInTheMonth) Dim dTemp dTemp = DateAdd("d", -(Day(dAnyDayInTheMonth) - 1), dAnyDayInTheMonth) GetWeekdayMonthStartsOn = WeekDay(dTemp) End Function 'Function SubtractOneMonth(dDate) ' SubtractOneMonth = DateAdd("m", -1, dDate) 'End Function 'Function AddOneMonth(dDate) ' AddOneMonth = DateAdd("m", 1, dDate) 'End Function ' ***End Function Declaration*** Function DrawMonth(numMonth, numYear) strValSQL = "SELECT * FROM Calendar WHERE Month(CaDate) = " & numMonth & " ORDER BY CaDate;" Set objConn = Server.CreateObject("ADODB.Connection") Set objRec = Server.CreateObject("ADODB.Recordset") objConn.Open strConnect objRec.Open strValSQL, objConn, 3,, 1 IF NOT objRec.EOF Then tempNumber = Day(objRec("CaDate")) End If Dim dDate ' Date we're displaying calendar for Dim iDIM ' Days In Month Dim iDOW ' Day Of Week that month starts on Dim iCurrent ' Variable we use to hold current day of month as we write table Dim iPosition ' Variable we use to hold current position in table tempDate = numMonth & "/1/" & numYear iDIM = GetDaysInMonth(Month(tempDate), Year(tempDate)) iDOW = GetWeekdayMonthStartsOn(tempDate) %> <% ' Write spacer cells at beginning of first row if month doesn't start on a Sunday. If iDOW <> 1 Then Response.Write vbTab & "" & vbCrLf iPosition = 1 Do While iPosition < iDOW Response.Write vbTab & vbTab & "" & vbCrLf iPosition = iPosition + 1 Loop End If ' Write days of month in proper day slots iCurrent = 1 iPosition = iDOW 'dDate = CDate(4/14/2001) Do While iCurrent <= iDIM ' If we're at the begginning of a row then write TR If iPosition = 1 Then Response.Write vbTab & "" & vbCrLf End If ' If the day we're writing is the selected day then highlight it somehow. 'If iCurrent = Day(dDate) Then If iCurrent = tempNumber Then Response.Write vbTab & vbTab & "" & vbCrLf If NOT objRec.EOF Then objRec.MoveNext End If If objRec.EOF Then tempNumber = 45 Else tempNumber = Day(objRec("CaDate")) End If Else Response.Write vbTab & vbTab & "" & vbCrLf End If ' If we're at the endof a row then write /TR If iPosition = 7 Then Response.Write vbTab & "" & vbCrLf iPosition = 0 End If ' Increment variables iCurrent = iCurrent + 1 iPosition = iPosition + 1 Loop ' Write spacer cells at end of last row if month doesn't end on a Saturday. If iPosition <> 1 Then Do While iPosition <= 7 Response.Write vbTab & vbTab & "" & vbCrLf iPosition = iPosition + 1 Loop Response.Write vbTab & "" & vbCrLf End If %>
<%= MonthName(numMonth) & " " & numYear %>
Sun
Mon
Tue
Wed
Thu
Fri
Sat
 
" & iCurrent & "" & iCurrent & "
 

<% objRec.Close objConn.Close end function If Request.QueryString = "a" Then For x = 1 to 12 Call DrawMonth(x, Year(Date)) Next Else Call DrawMonth(Month(Date), Year(Date)) If Month(Date)+1 > 12 then Call DrawMonth(Month(Date)-12+1, Year(Date)+1) Else Call DrawMonth(Month(Date)+1, Year(Date)) End If If Month(Date)+2 > 12 then Call DrawMonth(Month(Date)-12+2, Year(Date)+1) Else Call DrawMonth(Month(Date)+2, Year(Date)) End If End If %>