%@ LANGUAGE="VBScript" %> <% Option Explicit Dim dtToday dtToday = Date() Dim dtCurViewMonth ' First day of the currently viewed month Dim dtCurViewDay ' Current day of the currently viewed month %> <% REM This section defines functions to be used later on. %> <% REM This sets the Previous Sunday and the Current Month %> <% '-------------------------------------------------- Function DtPrevSunday(ByVal dt) Do While WeekDay(dt) > vbSunday dt = DateAdd("d", -1, dt) Loop DtPrevSunday = dt End Function '-------------------------------------------------- %> <%REM Set current view month from posted CURDATE, or ' the current date as appropriate. ' if posted from the form ' if prev button was hit on the form If InStr(1, Request.Form, "subPrev", 1) > 0 Then dtCurViewMonth = DateAdd("m", -1, Request.Form("CURDATE")) ' if next button was hit on the form ElseIf InStr(1, Request.Form, "subNext", 1) > 0 Then dtCurViewMonth = DateAdd("m", 1, Request.Form("CURDATE")) ' anyother time Else dtCurViewMonth = DateSerial(Year(dtToday), Month(dtToday), 1) End If %> <% REM --------BEGINNING OF DRAW CALENDAR SECTION-------- %> <% REM This section executes the event query and draws a matching calendar. %> <% Dim iDay, iWeek, sFontColor %>