<% ' Code by Mark Jones March 2002 ' This code generates a calendar based on the month and year incoded in the call to the routine. ' The calendars are suitable for saving as HTML for subsequent editting. A notable feature is that ' the calendars employ CSS and common headers and footers. ' ' Last modified ton 15 March 2002 to include default FrontPage meta commands. FP_flag = true 'true means FrontPage meta commands are used SB_flag = true 'true means FrontPage shared borders are used - requires FP_flag to be true abbreviate = true 'for month name ' separator is the separator between month and year in the page title ' three common alternatives are a space, a hyphen or nothing separator = "" CR = chr(13) 'carriage return LF = chr(10) ' line feed CRLF = CR&LF QM = chr(34) 'quotation mark cmd_var = request.querystring if cmd_var = "" then this_month = "" this_year = "" else dim cmdArray cmdArray = split(cmd_var, "&",2, vbTextCompare) this_month = cmdArray(0) if ubound(cmdArray) = 0 then this_year = "" else this_year = cmdArray(1) end if end if If this_month = "" Then this_month = Month(Date) End If If this_year = "" Then this_year = Year(Date) End If firstDay = Weekday(CDate(this_month & "/" & 1 & "/" & this_year)) leapTestNumbers = this_year / 4 leapTest = (leapTestNumbers) - Round(leapTestNumbers) If this_month = 2 Then If leapTest <> 0 Then lastDate = 28 Else lastDate = 29 End If ElseIf ((this_month = 4) OR (this_month = 6) OR (this_month = 9) OR (this_month = 11)) Then lastDate = 30 Else lastDate = 31 End If ' for includsion in a FrontPage web, some meta commands must be included if FP_flag then response.write("") response.write(CRLF) response.write("") response.write(CRLF) response.write("") response.write(CRLF) if SB_flag then response.write("") response.write(CRLF) end if else ' place default encoding desired here end if dateCounter = 1 weekDayCount = 1 %> <%=MonthName(this_month, abbreviate) & separator & this_year%>

<%=MonthName(this_month) & " " & this_year%>

Sunday Monday Tuesday Wednesday Thursday Friday Saturday
<% do while weekDayCount<=7 dateSelect = this_month & "/" & dateCounter & "/" & this_year if (weekDayCount < firstDay) OR (dateCounter > lastDate) then %> <% else if weekDayCount = 1 then%> <% else%> <% end if dateCounter = dateCounter+1 end if weekDayCount = weekDayCount+1 loop weekDayCount = 1 %> <% do while dateCounter <= lastDate %> <% do while weekDayCount<=7 dateSelect = this_month & "/" & dateCounter & "/" & this_year if dateCounter > lastDate then %> <% else if weekDayCount = 1 then%> <% else %> <% end if%> <% dateCounter = dateCounter+1 end if weekDayCount = weekDayCount+1 loop weekDayCount = 1 %> <%loop%>
 
 
 
 
 
 
 
 
<%=dateCounter%>

 
 
 
 
 
 
<%=dateCounter%>
 
 
<%=dateCounter%>

 
 
 
 
 
 
<%=dateCounter%>