Ciao a tutti,
ho utilizzato il seguente script per un calendario eventi, l'unico problema comincia da DOMENICA. come posso far si che inizia in modo clasico cioè da LUNEDI?
Grazie
codice:<TABLE cellSpacing=0 cellPadding=0 width=194 bgColor=#f5f5f6 border=0> <TBODY> <TR> <TD align="center" valign="middle" bgcolor="#2473CF" class="txpic"> [img]images/shim.gif[/img] Clicca sul giorno </TD> </TR> <TR> <TD width="194" align="center" valign="middle" bgcolor="#2473CF"><div align="center"> <% Function GetMonthName(Mesi) Select Case Mesi Case 1: GetMonthName="Gennaio" Case 2: GetMonthName="Febbraio" Case 3: GetMonthName="Marzo" Case 4: GetMonthName="Aprile" Case 5: GetMonthName="Maggio" Case 6: GetMonthName="Giugno" Case 7: GetMonthName="Luglio" Case 8: GetMonthName="Agosto" Case 9: GetMonthName="Settembre" Case 10: GetMonthName="Ottobre" Case 11: GetMonthName="Novembre" Case 12: GetMonthName="Dicembre" Case Else: GetMonthName="**Mese Errato**" End Select End Function Dim dataCorrente dataCorrente = Request("Date") If Len(dataCorrente) = 0 then dataCorrente = Date() end if Dim aCalendarDays(42) Dim iFirstWeekday iFirstWeekday = DatePart("w" ,DateSerial(Year(dataCorrente), Month(dataCorrente),1)) Dim iDaysInMonth iDaysInMonth = DatePart("d" ,DateSerial(Year(dataCorrente), Month(dataCorrente)+ 1, 1-1)) Dim iLoop For iLoop = 1 to iDaysInMonth aCalendarDays(iLoop + iFirstWeekday - 1) = iLoop Next Dim iColumns , iRows iColumns = 7 iRows = 6 - Int((42 -(iFirstWeekDay + iDaysInMonth)) / 7) Dim strPrevMonth, strNextMonth strPrevMonth = Server.URLEncode(DateAdd("m", - 1, dataCorrente)) strNextMonth = Server.URLEncode(DateAdd("m", 1, dataCorrente)) %> <link href="css/ac.css" rel="stylesheet" type="text/css"> <table align="center" border="2" cellspacing="1" width="170" cellpadding="0" class="testoca"> <tr> <th> < </th> <th colspan="5" class="txverdana"> <% response.write GetMonthName(Month(dataCorrente)) response.write " " & Year(dataCorrente) %> </th> <th> > </th> </tr> <% anno=Year(dataCorrente) mese=Month(dataCorrente) response.write ("<tr align='center' class='testoca'><td>D</td><td>L</td><td>M</td><td>M</td><td>G</td><td>V</td><td>S</td></tr>") Dim iRowsLoop, iColumnsLoop for iRowsLoop = 1 to iRows response.write "<tr>" for iColumnsLoop = 1 to iColumns set rs = cn.Execute("SELECT * FROM eventi WHERE gg = '" & aCalendarDays((iRowsLoop-1)* 7 + iColumnsLoop) & "' AND mm = '" & mese & "' AND aa = '" & anno & "' ") if Not rs.EOF then if aCalendarDays((iRowsLoop-1)*7 + iColumnsLoop) > 0 then response.write "<td valign=""center"" bgcolor=""#FFFFFF"" align=""center"" width=""10%"" class""testoca"">" response.write "" & giorno &"<div class""testoca"">"&aCalendarDays((iRowsLoop-1)* 7 + iColumnsLoop)&"</div>" response.write "</td>" else response.write "<td valign=""center"" align=""center"" width=""10%"" class=""testoca"">-</td>" end if else if aCalendarDays((iRowsLoop-1)*7 + iColumnsLoop) > 0 then response.write "<td valign=""center"" align=""center"" width=""10%"" class""testoca"">" response.write aCalendarDays((iRowsLoop-1)* 7 + iColumnsLoop) response.write "</td>" else response.write "<td valign=""center"" align=""center"" width=""10%"" class=""testoca""> -</td>" end if end if next response.write "</tr>" next cn.Close set cn = nothing %> </table> <center> <form action="index.asp#calendario" method=get class="searchsu"> <select size="1" name="Date"> <option value="<%=DateSerial(Year(dataCorrente),1 , 1)%>" <% if Month(dataCorrente) = 1 then response.write "selected" %> class="searchsu">Gennaio</option> <option value="<%=DateSerial(Year(dataCorrente),2 , 1)%>" <% if Month(dataCorrente) = 2 then response.write "selected" %> class="searchsu">Febbraio</option> <option value="<%=DateSerial(Year(dataCorrente),3 , 1)%>" <% if Month(dataCorrente) = 3 then response.write "selected" %> class="searchsu">Marzo</option> <option value="<%=DateSerial(Year(dataCorrente),4 , 1)%>" <% if Month(dataCorrente) = 4 then response.write "selected" %> class="searchsu">Aprile</option> <option value="<%=DateSerial(Year(dataCorrente),5 , 1)%>" <% if Month(dataCorrente) = 5 then response.write "selected" %> class="searchsu">Maggio</option> <option value="<%=DateSerial(Year(dataCorrente),6 , 1)%>" <% if Month(dataCorrente) = 6 then response.write "selected" %> class="searchsu">Giugno</option> <option value="<%=DateSerial(Year(dataCorrente),7 , 1)%>" <% if Month(dataCorrente) = 7 then response.write "selected" %> class="searchsu">Luglio</option> <option value="<%=DateSerial(Year(dataCorrente),8 , 1)%>" <% if Month(dataCorrente) = 8 then response.write "selected" %> class="searchsu">Agosto</option> <option value="<%=DateSerial(Year(dataCorrente),9 , 1)%>" <% if Month(dataCorrente) = 9 then response.write "selected" %> class="searchsu">Settembre</option> <option value="<%=DateSerial(Year(dataCorrente),10 , 1)%>" <% if Month(dataCorrente) = 10 then response.write "selected" %> class="searchsu">Ottobre</option> <option value="<%=DateSerial(Year(dataCorrente),11 , 1)%>" <% if Month(dataCorrente) = 11 then response.write "selected" %> class="searchsu">Novembre</option> <option value="<%=DateSerial(Year(dataCorrente),12 , 1)%>" <% if Month(dataCorrente) = 12 then response.write "selected" %> class="searchsu">Dicembre</option> </select> <input type=submit class="searchsu" value="Vai al Mese" > </form> </center> </div></TD> </TR> <TR> <TD align=center valign="middle" bgcolor="#2473CF"><div align="center">.:: Tutti Gli Eventi ::.</div></TD> </TR> </TBODY> </TABLE>

Rispondi quotando
manco riusciamo a metterci d'accordo su quale è il primo GGiorno della settimana...
