<% dim current_date, first_day, this_date dim counter,days, weeks, current_year ' Create an array to display the month names dim month_name(12) month_name(1)="January " month_name(2)="February " month_name(3)="March " month_name(4)="April " month_name(5)="May " month_name(6)="June " month_name(7)="July " month_name(8)="August " month_name(9)="September " month_name(10)="October " month_name(11)="November " month_name(12)="December " ' create a varible for the current date if request.QueryString("Result") = "" then current_date=date() else end if ' create a varible for the current year from the current date if request.QueryString("y") = "" then current_year=year(current_date) else current_year = request.QueryString("y") end if ' create a varible for the current day from the current date this_date=day(current_date) ' create a varible for the current month from the current date if request.QueryString("m") = "" then month_number=month(current_date) else month_number = request.QueryString("m") end if ' create a varible for the first day from the current date first_day=weekday(dateSerial(current_year,month_number,01)) ' create a varible for the length of the current month select case month_number ' For the months with 31 days set the end date case "1","3","5","7","8","10","12" last_day=31 ' For February set the end date by applying the leap year rules ' if the year is evenly divisable by 4 or ending in 00 divisable by 400 case "2" last_day=28 right_year_divided=current_year/4 if right_year_divided = cint(right_year_divided) then last_day=29 end if if right(current_year,2)="00" then right_year_divided=current_year/400 if right_year_divided = cint(right_year_divided) then last_day=29 end if ' end check of year values end if ' end check for new century ' All the rest of the months have 30 days case else last_day=30 end select ' end selct of month %> LaGrange, Wyoming Calendar
LaGrange, Wyo LaGrange, WY Home Page Contact LaGrange

* Click on date to view event details

<% dim url url = "calendar.asp" response.Write("") response.Write("") response.Write("") else response.Write("") end if response.Write("") response.Write("") %>
Today ") if month_number > 1 then response.Write("") else response.Write("") end if if month_number < 12 then response.Write("") else response.Write("") end if response.Write("") if getUserID() <> "" then response.Write("MembersAdmin
<% response.Write("" & month_name(month_number) & current_year & "") response.Write("") %>
<% ' Loop for the 1st week of the month for counter = 1 to 7 'if first_day = 1 and counter = 2 then 'days=days+1 'end if If counter > first_day-1 Then %><% next %> <% ' Loop for the remaining weeks in the month for weeks = 1 to 7 %> <% ' Loop of the remaing days of the month for counter = 1 to 7 ' Count for days days=days+1 ' Write out the date and place in bold if it's the current date if days <= last_day then If days=this_date Then %> <% end if ' End check for end of month next %> <% next %>
Sun Mon Tue Wed Thur Fri Sat
<% Else %><% End If ' Check to see what day the first of the month falls on if counter > first_day-1 then ' Count for days days=days+1 ' Check to see if the current date is in the 1st week ' if so place it in bold type if cdate(month_number & "/" & days & "/" & current_year) = cdate(formatdatetime(now(),2)) then%> <%response.write("" & days & "")%> <%else%> <%response.write(days)%> <%'response.write days end if ' End check for current date Mydate = (month_number & "/" & days & "/" & current_year) getEvents() end if ' End check for first day of the week 'response.Write(first_day) %>
<% Else %><% End If if cdate(month_number & "/" & days & "/" & current_year) = cdate(formatdatetime(now(),2)) then%> <%response.write("" & days & "")%> <%else%> <%response.write(days)%> <%'response.write days end if ' End check for current date Mydate = (month_number & "/" & days & "/" & current_year) getEvents() %>
<% Private Function getEvents() set connEvent = server.CreateObject("ADODB.connection") set recsetEvent = server.CreateObject("ADODB.recordset") 'Mydate = (month_number & "/" & days & "/" & current_year) strsqlEvent = "SELECT * FROM Events where Format(EventDate, 'MM/DD/YYYY') = Format(#" & Mydate & "#, 'MM/DD/YYYY') order by EventDate" 'strsqlCom = "SELECT * FROM Comments" connEvent.open strConnString recsetEvent.open strsqlEvent, connEvent, 1, 2 if recsetEvent.eof = false then 'response.Write("
Comments
") end if 'response.Write(MyDate) while not(recsetEvent.eof) %>
<%if formatdatetime(recsetEvent("EventDate"),3) = "00:00" then response.Write("" & recsetEvent("Subject") & "
") else response.Write(formatdatetime(recsetEvent("EventDate"),3) & " - " & recsetEvent("Subject") & "
") end if %>
<% recsetEvent.movenext wend recsetEvent.close connEvent.close End Function %>
SSL Certificate