calendario del año
|
<html>
<head>
<title>Calendario del año 2005</title>
</head>
<body>
<div align="center">
<center>
<table border="0" cellpadding="0" cellspacing="0" width="400">
<tr>
<td>
<p align="center">
<script language="javascript">
<!--
// fill the month table with column headings
function day_title(day_name){
document.write("<TD ALIGN=center WIDTH=35>"+day_name+"</TD>")
}
// fills the month table with numbers
function fill_table(month,month_length)
{
day=1
// begin the new month table
document.write("<TABLE BORDER=3 CELLSPACING=3 CELLPADDING=%3><TR>")
document.write("<TD COLSPAN=7 ALIGN=center><B>"+month+" "+year+"</B><TR>")
// column headings
day_title("Dom")
day_title("Lun")
day_title("Mar")
day_title("Mie")
day_title("Jue")
day_title("Vie")
day_title("Sab")
// pad cells before first day of month
document.write("</TR><TR>")
for (var i=1;i<start_day;i++){
document.write("<TD>")
}
// fill the first week of days
for (var i=start_day;i<8;i++){
document.write("<TD ALIGN=center>"+day+"</TD>")
day++
}
document.write("<TR>")
// fill the remaining weeks
while (day <= month_length) {
for (var i=1;i<=7 && day<=month_length;i++){
document.write("<TD ALIGN=center>"+day+"</TD>")
day++
}
document.write("</TR><TR>")
// the first day of the next month
start_day=i
}
document.write("</TR></TABLE><BR>")
}
// end hiding -->
</script>
<script language="javascript">
// year
year=2010
// first day of the week of the new year
today= new Date("January 1, "+year)
start_day = today.getDay() + 1 // starts with 0
fill_table("Enero",31)
fill_table("Febrero",28)
fill_table("Marzo",31)
fill_table("Abril",30)
fill_table("Mayo",31)
fill_table("Junio",30)
fill_table("Julio",31)
fill_table("Agosto",31)
fill_table("Septiembre",30)
fill_table("Octubre",31)
fill_table("Noviembre",30)
fill_table("Diciembre",31)
</script>
</td>
</tr>
</table>
</center>
</html>