Redigering af kalender
Hej. nogen der kan hjælpe med at redigere denne ASP-kalender?1) Så den altid viser 6 rækker, uanset hvor mange dage der er i en måned.
2) Markere en dato med en anden farve og link hvis den er f.eks er 15-05-2007
<%
dtmDate = Request.QueryString("date")
dtmToday = Date
If dtmDate = "" Then
dtmDate = Date
Else
dtmDate = CDate(dtmDate)
End if
intYear = Year(dtmDate)
strMonth = MonthName(Month(dtmDate))
intDayOfMonth = Day(dtmDate)
dtmFirstDate = DateAdd("d", (-intDayOfMonth)+1, dtmDate)
intFirstDay = Weekday(dtmFirstDate, vbMonday)
%>
<p align="center"><font face="verdana" size="4">Kalender</font></p>
<div align="center"><center>
<table cellspacing="0" cellpadding="2" border="0" valign="top"
style="border: 1px solid rgb(0,0,0)">
<tr>
<td colspan="7" align="center" valign="middle" bgcolor="#000000"><font face="Verdana"
size="2" color="#ffffff"><strong><%=strMonth%> <%=intYear%></strong></font></td>
</tr>
<tr>
<td align="center"><font face="verdana" size="2">Man</font></td>
<td align="center"><font face="verdana" size="2">Tir</font></td>
<td align="center"><font face="verdana" size="2">Ons</font></td>
<td align="center"><font face="verdana" size="2">Tor</font></td>
<td align="center"><font face="verdana" size="2">Fre</font></td>
<td align="center"><font face="verdana" size="2">Lør</font></td>
<td align="center"><font face="verdana" size="2">Søn</font></td>
</tr>
<%
For y = 1 to 6
If blnLast <> True Then
Response.Write "<tr>"
For x = 1 to 7
Response.Write "<td align=center><font face=verdana size=2>"
intLoopDay = intLoopDay + 1
If intLoopDay >= intFirstDay Then
dtmCurDate = DateAdd("d", intLoopDay-intFirstDay, dtmFirstDate)
If Month(dtmCurDate) = Month(dtmFirstDate) Then
If dtmCurDate = dtmToday Then
Response.Write "<strong><font color=#ff0000>"
End If
Response.Write Day(dtmCurDate)
Response.Write "</strong></td>"
blnLast = False
Else
Response.Write "-</td>"
blnLast = True
End If
Else
Response.Write "-</td>"
blnLast = True
End if
Next
End If
Next
Response.Write "</font></td></tr>"
%>
<tr>
<td bgcolor="#000000" colspan="3"><font face="verdana" size="2"><b><a
href="kalender.asp?date=<%=DateAdd("m",-1,dtmFirstDate)%>">Forrige</a></b></font></td>
<td bgcolor="#000000"> </td>
<td bgcolor="#000000" colspan="3" align="right"><font face="verdana" size="2"><b><a
href="kalender.asp?date=<%=DateAdd("m",1,dtmFirstDate)%>">Næste</a></b></font></td>
</tr>
</table>
</center></div>