Tutto quello che ti posso dare, è questo:
codice:
<%@LANGUAGE="VBSCRIPT"%>
<% Session.LCID = 1040 %>
<%
Function nome_esteso(mese)
nome_esteso = split(Formatdatetime(mese, vblongdate))(2)
nome_esteso = Ucase(Left(nome_esteso,1)) & Mid(nome_esteso,2) & " " & year(mese)
End function
Function festa(giorno)
data_corrente = giorno & "/" & month(inizio_mese_corrente) & "/" & anno
If data_corrente = Pasqua or data_corrente = Pasquetta or data_corrente = "1/1/" & anno or data_corrente = "6/1/" & anno or data_corrente = "1/1/" & anno or data_corrente = "25/4/" & anno or data_corrente = "1/5/" & anno or data_corrente = "15/8/" & anno or data_corrente = "1/11/" & anno or data_corrente = "8/12/" & anno or data_corrente = "25/12/" & anno or data_corrente = "26/12/" & anno then
festa = true
Else
festa = false
End if
End function
%>
<html>
<head>
<title>Calendario</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style>
BODY {MARGIN: 1px}
.testobianco12B { font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-color: #FFFFFF; color: #FFFFFF; font-weight: bold}
</style>
<script language="JavaScript">
function inser_data(var_form,var_campo,var_giorno,var_mese,var_anno) {
if (var_giorno.length == 1) {var_giorno = '0'+var_giorno}
if (var_mese.length == 1) {var_mese = '0'+var_mese}
window.opener.document.forms[var_form].elements[var_campo].value = var_giorno+'\/'+var_mese+'\/'+var_anno;
window.opener.focus();
window.close();
}
</script>
</head>
<body bgcolor="#006699" link="#FFFFFF" vlink="#FFFFFF" alink="#FFFFFF">
<table border="0" cellpadding="0" cellspacing="0" class="testobianco12B">
<tr>
<%
nomeform = Request.Querystring("nomeform")
nomecampo = Request.Querystring("nomecampo")
inizio_mese_corrente = Request.QueryString("inizio_mese_corrente")
If inizio_mese_corrente = "" then
inizio_mese_corrente = cdate("01/" & month(date) & "/" & year(date))
Else
inizio_mese_corrente = cdate(inizio_mese_corrente)
End if
inizio_mese_precedente = DateAdd("m", -1, inizio_mese_corrente)
inizio_mese_successivo = DateAdd("m", 1, inizio_mese_corrente)
'Determino le festività
'Pasqua
Anno = year(inizio_mese_corrente)
A = Anno Mod 19
B = Anno \ 100
C = Anno Mod 100
D = B \ 4
E = B Mod 4
F = (B + 8) \ 25
G = (B - F + 1) \ 3
H = (19 * A + B - D - G + 15) Mod 30
I = C \ 4
K = C Mod 4
L = (32 + E + E + I + I - H - K) Mod 7
M = (A + 11 * H + 22 * L) \ 451
N = (H + L - 7 * M + 114)
Mese = N \ 31
Giorno = (N Mod 31) + 1
Pasqua = Cdate(Giorno & "/" & Mese & "/" & Anno)
Pasquetta = DateAdd("d", 1, Pasqua)
Pasqua = Replace(Pasqua,"/03/", "/3/")
Pasqua = Replace(Pasqua,"/04/", "/4/")
Pasquetta = Replace(Pasquetta,"/03/", "/3/")
Pasquetta = Replace(Pasquetta,"/04/", "/4/")
primo_lun = inizio_mese_corrente
Do while not DatePart("w", primo_lun, 2) = 1
primo_lun = primo_lun + 1
Loop
primo_lun = day(primo_lun)
If primo_lun = 1 then
giorno_set = 1
Else
giorno_set = 9 - primo_lun
End if
ultimo_giorno_mese = DateAdd("m", 1, inizio_mese_corrente)
ultimo_giorno_mese = DateAdd("d", -1, ultimo_giorno_mese)
%>
<td width="170" align="center" valign="middle"><table width="150" border="0" cellpadding="0" cellspacing="0" class="testobianco12B">
<tr>
<td width="20"><font color="#FFCC00"><<</font></td>
<td align="center"><font color="#FFCC00"><%= nome_esteso(inizio_mese_corrente) %></font></td>
<td width="20" align="right">>></td>
</tr>
</table>
<table width="150" border="0" cellpadding="0" cellspacing="0" class="testobianco12B">
<tr align="center" bgcolor="6699cc">
<td height="2" colspan="7"></td>
</tr>
<tr align="center">
<td>l</td>
<td>m</td>
<td>m</td>
<td>g</td>
<td>v</td>
<td>s</td>
<td><font color="#FFCC00">d</font></td>
</tr>
<tr align="center" bgcolor="6699cc">
<td height="2" colspan="7"></td>
</tr>
<tr align="center">
<%
For i = 1 to 7
%>
<td>
<%
If i >= giorno_set then
giorno_corrente = giorno_corrente + 1
If i = 7 or festa(giorno_corrente) = true then
%>
<font color="#FFCC00"><%= giorno_corrente %></font>
<%
Else
%>
<%= giorno_corrente %>
<%
End if
End if
%>
</td>
<%
Next
%>
</tr>
<tr align="center">
<%
For i = 1 to 7
%>
<td>
<%
giorno_corrente = giorno_corrente + 1
If i = 7 or festa(giorno_corrente) = true then
%>
<font color="#FFCC00"><%= giorno_corrente %></font>
<%
Else
%>
<%= giorno_corrente %>
<%
End if
%>
</td>
<%
Next
%>
</tr>
<tr align="center">
<%
For i = 1 to 7
%>
<td>
<%
giorno_corrente = giorno_corrente + 1
If i = 7 or festa(giorno_corrente) = true then
%>
<font color="#FFCC00"><%= giorno_corrente %></font>
<%
Else
%>
<%= giorno_corrente %>
<%
End if
%>
</td>
<%
Next
%>
</tr>
<tr align="center">
<%
For i = 1 to 7
%>
<td>
<%
giorno_corrente = giorno_corrente + 1
If giorno_corrente <= day(ultimo_giorno_mese) then
If i = 7 or festa(giorno_corrente) = true then
%>
<font color="#FFCC00"><%= giorno_corrente %></font>
<%
Else
%>
<%= giorno_corrente %>
<%
End if
End if
%>
</td>
<%
Next
%>
</tr>
<tr align="center">
<%
For i = 1 to 7
%>
<td>
<%
giorno_corrente = giorno_corrente + 1
If giorno_corrente <= day(ultimo_giorno_mese) then
If i = 7 or festa(giorno_corrente) = true then
%>
<font color="#FFCC00"><%= giorno_corrente %></font>
<%
Else
%>
<%= giorno_corrente %>
<%
End if
Else
%>
[img]../img/trasparente.gif[/img]
<%
End if
%>
</td>
<%
Next
%>
</tr>
<tr align="center">
<%
For i = 1 to 7
%>
<td>
<%
giorno_corrente = giorno_corrente + 1
If giorno_corrente <= day(ultimo_giorno_mese) then
If i = 7 or festa(giorno_corrente) = true then
%>
<font color="#FFCC00"><%= giorno_corrente %></font>
<%
Else
%>
<%= giorno_corrente %>
<%
End if
Else
%>
[img]../img/trasparente.gif[/img]
<%
End if
%>
</td>
<%
Next
%>
</tr>
<tr align="center" bgcolor="6699cc">
<td height="2" colspan="7"></td>
</tr>
<tr valign="bottom">
<td height="20" colspan="7" align="center">Chiudi</td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>