
28/10/2003, 22:49
|
 | | | Fecha de Ingreso: diciembre-2002 Ubicación: Ahora aqui
Mensajes: 485
Antigüedad: 22 años, 5 meses Puntos: 0 | |
El codigo que yo tengo para el calendario es el siguiente
<style>
<!--
.Title { font-family: Tahoma; font-size: 10pt; font-weight: bold }
.Text { font-family: Tahoma; font-size: 8pt; font-weight: bold }
.Smalltext { font-family: Tahoma; font-size: 8pt }
-->
</style>
<%
MyMonth = Month(Date)
MyYear = Year(Date)
FirstDay = WeekDay(DateSerial(MyYear, MyMonth, 1)) -1
CurrentDay = 1
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
Response.Write "<table border='0' cellpadding='0' cellspacing='0' width='130'>"
Response.Write "<tr>"
Response.Write "<td align='center' width='18'><p class='Text'>D</td>"
Response.Write "<td align='center' width='18'><p class='Text'>L</td>"
Response.Write "<td align='center' width='18'><p class='Text'>M</td>"
Response.Write "<td align='center' width='18'><p class='Text'>M</td>"
Response.Write "<td align='center' width='18'><p class='Text'>J</td>"
Response.Write "<td align='center' width='18'><p class='Text'>V</td>"
Response.Write "<td align='center' width='18'><p class='Text'>S</td>"
Response.Write "</tr>"
Response.Write "<tr>"
For Row = 0 to 5
For Col = 0 to 6
If Row = 0 and Col < FirstDay Then
Response.Write "<td> </td>"
ElseIf CurrentDay > LastDay(MyMonth, MyYear) Then
Response.Write "<td> </td>"
Else
If cInt(MyYear) = Year(Date) and cInt(MyMonth) = Month(Date) and CurrentDay = Day(Date) Then
Response.write "<td align='center' width='18' bgcolor='#FFFF00'><p class='Smalltext'>"&CurrentDay&"</td>"
Else
Response.Write "<td align='center' width='18'><p class='Smalltext'>"&CurrentDay&"</td>"
End If
CurrentDay = CurrentDay + 1
End If
Next
Response.Write "</tr>"
Next
Response.Write "</table>"
%>
Talvez alguien me lo puede mejorar, puesto que yo lo estoy haciendo lo con poco que se de ASP |