Questo è il codice per un semplice calendario.
Il resto prova ad implementarlo tu.
codice:
<%
giorno = request.queryString("giorno")
mese = request.queryString("mese")
anno = request.queryString("anno")
if len(giorno) = 0 or not isNumeric(giorno) then giorno = datePart("d",date())
if len(mese) = 0 or not isNumeric(mese) then mese = datePart("m",date())
if len(anno) = 0 or not isNumeric(anno) then anno = datePart("yyyy",date())
dataCorrente = giorno & "/" & mese & "/" & anno
if not isDate(dataCorrente) then dataCorrente = formatDateTime(date(),vbGeneralDate)
giorno = datePart("d",dataCorrente)
mese = datePart("m",dataCorrente)
anno = datePart("yyyy",dataCorrente)
primoGiornoMese = cDate("01" & "/" & mese & "/" & anno)
primoGiornoSettimanaMese = datePart("w",primoGiornoMese)
%>
<table border="1">
<tr>
<td colspan="7"><%=uCase(monthName(mese))%><%=anno%></td>
</tr>
<tr>
<td>D</td>
<td>L</td>
<td>M</td>
<td>M</td>
<td>G</td>
<td>V</td>
<td>S</td>
</tr>
<tr>
<%
for i = 1 to (primoGiornoSettimanaMese - 1)
%>
<td></td>
<%
next
for g = 1 to 31
tmpDate = g & "/" & mese & "/" & anno
if isDate(tmpDate) then
%>
<td><%=g%></td>
<%
if datePart("w",tmpDate) = 7 then
response.write " </tr>" & vbCrLf
response.write " <tr>" & vbCrLf
end if
ultimoGiornoSettimanaMese = datePart("w",tmpDate)
end if
next
for i = (ultimoGiornoSettimanaMese + 1) to 7
%>
<td></td>
<%
next
mesePrecedente = dateAdd("m",-1,primoGiornoMese)
meseSuccessivo = dateAdd("m",1,primoGiornoMese)
%>
</tr>
<tr>
<td colspan="2">&mese=<%=datePart("m",mesePrecedente)%>&anno=<%=datePart("yyyy",mesePrecedente)%>">«</td>
<td colspan="3"></td>
<td colspan="2">&mese=<%=datePart("m",meseSuccessivo)%>&anno=<%=datePart("yyyy",meseSuccessivo)%>">»</td>
</tr>
</table>