Prova questo, l'avevo trovato in giro e modificato per renderlo un pò più carino:
codice:
<%
Response.Expires = -1
Response.ExpiresAbsolute = Now() - 2
Response.AddHeader "pragma","no-cache"
Response.AddHeader "cache-control","private"
Response.CacheControl = "No-Store"
Dim MyMonth 'Month of calendar
Dim MyYear 'Year of calendar
Dim FirstDay 'First day of the month. 1 = Monday
Dim CurrentDay 'Used to print dates in calendar
Dim Col 'Calendar column
Dim Row 'Calendar row
MyMonth = Request.Querystring("Month")
MyYear = Request.Querystring("Year")
If IsEmpty(MyMonth) then MyMonth = Month(Date)
if IsEmpty(MyYear) then MyYear = Year(Date)
Call ShowHeader (MyMonth, MyYear)
FirstDay = WeekDay(DateSerial(MyYear, MyMonth, 1)) -1
CurrentDay = 1
'Let's build the calendar
For Row = 0 to 5
Response.write "<tr class=""giorni"">" & Chr(13)
For Col = 0 to 6
If Row = 0 and Col < FirstDay then
response.write "<td></td>" & Chr(13)
elseif CurrentDay > LastDay(MyMonth, MyYear) then
response.write "<td></td>" & Chr(13)
else
response.write "<td"
if CInt(MyMonth) = CInt(Month(Date)) and CInt(CurrentDay) = CInt(Day(Date)) then
response.write " bgcolor=""#0066FF"" align=""center"">"
else
response.write " align=""center"">"
end if
If col = 0 OR SpecialDay(CurrentDay & "/" & MyMonth) Then
Response.write "<font color=""#FF0000"">"& CurrentDay & "</font></td>" & Chr(13)
Elseif CInt(MyMonth) = CInt(Month(Date)) and CInt(CurrentDay) = CInt(Day(Date)) then
Response.write "<font color=""#FFFFFF"">" & CurrentDay & "</font></td>" & Chr(13)
Else
Response.write CurrentDay & "</td>" & Chr(13)
End If
CurrentDay = CurrentDay + 1
End If
Next
response.write "</tr>" & Chr(13)
If CurrentDay - 1 = LastDay(MyMonth, MyYear) Then Exit For
Next
response.write "</table></body></html>"
'------ Sub and functions
Sub ShowHeader(MyMonth,MyYear)
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
.giorni {
font-family: Arial, Helvetica, sans-serif;
font-size: 8pt;
color: #000000;
text-align: center;
}
.giorni_sett {
font-family: Arial, Helvetica, sans-serif;
font-size: 8pt;
color: #FFFFFF;
text-align: center;
}
-->
</style>
<title>Calendario</title></head>
<body bgcolor="#FFFFFF">
<table border="1" cellspacing="0" cellpadding="3" width="200" align="center" bordercolor="#0066FF">
<tr align="center">
<td colspan="7">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="left">
<font face="Arial, Helvetica, sans-serif" size="1">
<%
response.write "<a href = ""calendario.asp?"
if MyMonth - 1 = 0 then
response.write "month=12&year=" & MyYear -1
else
response.write "month=" & MyMonth - 1 & "&year=" & MyYear
end if
response.write """><font size=""-1""><</font></a>"
%>
</font>
</td><td align="center">
<font face="Arial, Helvetica, sans-serif" size="1">
<%
response.write "" & MonthName(MyMonth) & " " & MyYear & ""
%>
</font>
</td><td align="right">
<font face="Arial, Helvetica, sans-serif" size="1">
<%
response.write "<a href = ""calendario.asp?"
if MyMonth + 1 = 13 then
response.write "month=1&year=" & MyYear + 1
else
response.write "month=" & MyMonth + 1 & "&year=" & MyYear
end if
response.write """><font size=""-1"">></font></a>"
%>
</font>
</td></tr></table>
</td>
</tr>
<tr align="center" class="giorni_sett">
<td bgcolor="#0066FF">Dom</td>
<td bgcolor="#0066FF">Lun</td>
<td bgcolor="#0066FF">Mar</td>
<td bgcolor="#0066FF">Mer</td>
<td bgcolor="#0066FF">Gio</td>
<td bgcolor="#0066FF">Ven</td>
<td bgcolor="#0066FF">Sab</td>
</tr>
<%
End Sub 'ShowHeader
Function MonthName(MyMonth)
Select Case MyMonth
Case 1
MonthName = "Gennaio"
Case 2
MonthName = "Febbraio"
Case 3
MonthName = "Marzo"
Case 4
MonthName = "Aprile"
Case 5
MonthName = "Maggio"
Case 6
MonthName = "Giugno"
Case 7
MonthName = "Luglio"
Case 8
MonthName = "Agosto"
Case 9
MonthName = "Settembre"
Case 10
MonthName = "Ottobre"
Case 11
MonthName = "Novembre"
Case 12
MonthName = "Dicembre"
Case Else
MonthName = "ERROR!"
End Select
End Function
Function LastDay(MyMonth, MyYear)
Select Case MyMonth
Case 1, 3, 5, 7, 8, 10, 12
LastDay = 31
Case 4, 6, 9, 11
LastDay = 30
Case 2
If IsDate(MyYear & "-" & MyMonth & "-" & "29") Then LastDay = 29 Else LastDay = 28
Case Else
LastDay = 0
End Select
End Function
Function SpecialDay(MyDate)
fest = Array("1/1","6/1","15/8","1/11","8/12","25/12")
SpecialDay = False
For i = 0 To Ubound(fest)
If fest(i) = MyDate Then
SpecialDay = True
Exit Function
End If
Next
End Function
%>