%
widecontent=1
if request("view_date")="" then
view_date= day(Now()) & "-" & monthname(month(Now())) & "-" & year(Now())
iso_date=Year(Now()) & "/" & Month(Now()) & "/" & Day(Now())
else
view_date=request("view_date")
iso_date=request("view_date")
end if
Dim dtToday
dtToday = Date()
Dim dtCurViewMonth ' First day of the currently viewed month'
Dim dtCurViewDay ' Current day of the currently viewed month'
prev_iso_date = dateadd("m", -1, view_date)
prev_iso_date = year(prev_iso_date) & "/" & month(prev_iso_date) & "/" & day(prev_iso_date)
next_iso_date = dateadd("m", 1, view_date)
next_iso_date = year(next_iso_date) & "/" & month(next_iso_date) & "/" & day(next_iso_date)
' Get first day of month'
dttmp = view_date
dtday = day(dttmp)
dttmp = dateadd("d", (-dtday+1), dttmp)
dtCurViewMonth = dttmp
'firstday=weekday(Trim(cstr(Month(dtCurViewMonth))) & "/1/" & Trim(cstr(Year(dtCurViewMonth))))
firstday=weekday("1-"&MonthName(Month((dtCurViewMonth)))&"-"&cstr(Year(dtCurViewMonth)))
DaysInMonth = DateSerial(Year(view_date), Month(view_date) + 1, 1) - DateSerial(Year(view_date), Month(view_date), 1)
weeks=int((firstday+daysinmonth - 1)/7)
If (firstday+daysinmonth-1) mod 7 <> 0 then
weeks=weeks +1
end if
remains=((firstday+daysinmonth - 1) mod 7)
If Remains=0 then
Remains=7
End if
%>
<%
sql = "SELECT CDescription FROM CalendarType where CtypeID=" & cint(CTypeID)
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open sql, conn, 3, 3
If CTypeID<>"0" then
TypeName1=rs("Cdescription")
Else
TypeName1="Calendar"
End if
%>
<%
rs.close
set rs=nothing
%>
|
|
<%
if FirstDayShow=0 then
Call GenerateCalendar
else
Call GenerateCalendarM
end if
%>