% Set objConn = Server.CreateObject("ADODB.Connection") objConn.open Application("ConnectionString") function getval(field, alt) if rs.eof then getval = alt else getval = rs(field) end if end function function getMonthDays(monthVal, yearVal) if monthVal > 12 or monthVal < 1 then getMonthDays = 0 elseif monthVal = 4 OR monthVal = 6 OR monthVal = 9 OR monthVal = 11 then 'april, june, september, and november have 30 days getMonthDays = 30 elseif monthVal = 2 then 'figure out if it is a leap year if yearVal mod 100 = 0 then if yearVal mod 400 = 0 then getMonthDays = 29 else getMonthDays = 28 end if else if yearVal mod 4 = 0 then getMonthDays = 29 else getMonthDays = 28 end if end if else 'all the rest have 31 getMonthDays = 31 end if end function %>
Event: | <%
end if
if false then 'admin info
%>
<%= rs("firstdate") & " " & rs("lastdate") & " " & SQL & " " %> <% end if response.write rs("Event") if false then 'admin info %> <%= SQL %> <% end if%> |
Dates/Times: |
<%
'parse out dates and times for each event
previousdate = null
do until rsDates.eof 'cycle through each date
firstdate = rsDates("date")
lasttime = rsDates("time")
lastyear = year(rsDates("date"))
thisdate = true
if isnull(previousdate) then
response.write monthname(month(firstdate)) & " " & day(firstdate)
else
if month(previousdate) = month(firstdate) AND year(previousdate) = year(firstdate) AND not newtime then
response.write ", "
else
if lastyear <> year(lastdate) then
response.write " " & lastyear end if response.write " " & monthname(month(firstdate)) & " " end if response.write day(firstdate) end if do until not thisdate lastdate = rsDates("date") rsDates.movenext if rsDates.eof then thisdate = false else if datediff("d",rsDates("Date"),dateadd("d",1,lastdate)) <> 0 then thisdate = false end if if (lasttime <> rsDates("time")) then thisdate = false end if end if if not thisdate then 'response.write lastdate if firstdate <> lastdate then 'if false then if datediff("d",firstdate,lastdate) = 1 then response.write ", " else response.write " – " end if if month(lastdate) <> month(firstdate) OR year(lastdate) <> year(firstdate) then if lastyear <> year(lastdate) then response.write " " & year(lastdate) end if response.write " " & monthname(month(lastdate)) & " " lastyear = year(lastdate) end if response.write day(lastdate) end if previousdate = lastdate end if newtime = false if trim(lasttime) <> "" then if rsDates.eof or rsDates.bof then response.write " " & datepart("yyyy",firstdate) & " " & replace(lasttime,"|"," - ") newtime = true else if lasttime <> rsDates("Time") then response.write " " & datepart("yyyy",firstdate) & " " & replace(lasttime,"|"," - ") newtime = true end if end if end if loop loop response.write " |
Location: | " & rs("Location") & " |
Description: | " & rs("Description") & " |