Esatto, però il tutto deve essere stampato in uno script di calendario:
codice:
<%
dim nextmonth
dim acalandardays(42)
nextmonth = 0
dbcurrentdate = date()
if res="Yes" then
whichdate="01" & "/" & whichmonth & "/" & whichyear
if whataction="Next" then
dbcurrentdate=dateadd("m",1,cdate(whichdate))
elseif whataction="Prev" then
dbcurrentdate=dateadd("m",-1,cdate(whichdate))
else
dbcurrentdate=whichdate
end if
end if
Dim dbcurrentdate
dim ifirstweekday
ifirstweekday = datepart("W",dateserial(year(dbcurrentdate),month(dbcurrentdate),1))
dim idaysinmonth
idaysinmonth = datepart("d",dateserial(year(dbcurrentdate),month(dbcurrentdate)+1,1-1))
dim iloop
for iloop = 1 to idaysinmonth
acalandardays(iloop+ifirstweekday-1)=iloop
next
dim icolumns,irows
icolumns = 7
irows = 6-int((42-(ifirstweekday+idaysinmonth))/7)
%>
<table align =center border=1 cellspacing = 1 width=45% height=45%>
<th colspan=7 bgcolor=lightblue>
<%
curmonth=monthname(month(dbcurrentdate))
Response.Write curmonth
curyear=year(dbcurrentdate)
Response.Write " " & curyear
Response.Write "<tr>"
Response.Write "<td align=center>"
Response.Write "<font color=red><b>"
Response.Write "Sun"
Response.Write "</font>"
Response.Write "</td>"
Response.Write "<td align=center><b>"
Response.Write "Mon"
Response.Write "</td>"
Response.Write "<td align=center><b>"
Response.Write "Tue"
Response.Write "</td>"
Response.Write "<td align=center><b>"
Response.Write "Wed"
Response.Write "</td>"
Response.Write "<td align=center><b>"
Response.Write "Thu"
Response.Write "</td>"
Response.Write "<td align=center><b>"
Response.Write "Fri"
Response.Write "</td>"
Response.Write "<td align=center><b>"
Response.Write "Sat"
Response.Write "</td>"
Response.Write "</tr>"
dim irowsloop ,icolumnsloop
startday=weekday("01" & "/" & monthname(month(dbcurrentdate)) & "/" & year(dbcurrentdate))
ctr=1
for irowsloop = 1 to irows
Response.Write "<tr>"
if ctr=1 then
colm = startday
else
colm=1
end if
if startday>1 then
diff=colm - 1
end if
for icolumnsloop=colm to icolumns
if acalandardays((irowsloop-1)*7 +icolumnsloop) >= 0 then
if diff>0 then
for p=1 to diff
Response.Write "<td valign= top align=right width=""14%"">"
Response.Write "</td>"
next
diff=0
end if
Response.Write "<td valign= top align=right width=""14%"">"
DataCorrente=acalandardays((irowsloop-1)*7 + icolumnsloop)
%>
<%
' qui stampo la data del calendario ----------------------
Response.Write(DataCorrente)
%>
<%
Response.Write "</td>"
else
Response.Write "<td> </td>"
end if
ctr=2
next
Response.Write "</tr>"
colm=2
next
Response.Write "<br>"
%>
</table>