codigo de un calendario en html
queremos un ejemplo con el codigo de un calendario diseñado en html el mismo que al seleccionar por medio de un combo el mes y el año se despliege en forma de un calendario. O corregir el codigo del siguiente calendario y a la vez traducir linea por linea del codigo lo que realiza cada una.
gracias
<HTML>
<HEAD>
<TITLE></TITLE>
</HEAD>
<BODY> <SCRIPT LANGUAGE="JavaScript">
<!--
now = new Date();
nowDay = now.getDay();
nowDate = now.getDate();
nowMonth = now.getMonth() + 1;
nowYear = new String(now.getYear());
nowyearLen = nowYear.length
nowYear = nowYear.split("")
nowYear = nowYear[nowyearLen - 2] + nowYear[nowyearLen - 1]
j = 31;
startDate = 1;
tmpDate = nowDate;
tmpDay = nowDay;
start = false;
end = false;
monthName = new Array();
monthName[1] = "January";
monthName[2] = "February";
monthName[3] = "March";
monthName[4] = "April";
monthName[5] = "May";
monthName[6] = "June";
monthName[7] = "July";
monthName[8] = "August";
monthName[9] = "September";
monthName[10] = "October";
monthName[11] = "November";
monthName[12] = "December";
monthLen = new Array();
monthLen[1] = "31";
monthLen[2] = "28";
monthLen[3] = "31";
monthLen[4] = "30";
monthLen[5] = "31";
monthLen[6] = "30";
monthLen[7] = "31";
monthLen[8] = "31";
monthLen[9] = "30";
monthLen[10] = "31";
monthLen[11] = "30";
monthLen[12] = "31";
for (i = 0; i < j; i++){
tmpDate--;
tmpDay--;
if (tmpDay < 0){
tmpDay = 6;
}
if (tmpDate == 1){
i = 31;
}
}
document.write("<table border=2 bgcolor='white'><tr><td><table><tr>")
document.write("<td WIDTH=211 ALIGN=CENTER>" + monthName[nowMonth] + ' ' + nowYear + "</td>")
document.write("</tr></table><table border=2><tr>")
document.write("<td WIDTH=25 ALIGN=CENTER>SU</td><td WIDTH=25 ALIGN=CENTER>M</td><td WIDTH=25 ALIGN=CENTER>T</td><td WIDTH=25 ALIGN=CENTER>W</td><td WIDTH=25 ALIGN=CENTER>TH</td><td WIDTH=25 ALIGN=CENTER>F</td><td WIDTH=25 ALIGN=CENTER>SA</td></tr><tr>")
for (i = 0; i < 7; i++){
for (week = 0; week <= 6; week++){
if (startDate == nowDate){
document.write("<td WIDTH=25 ALIGN=CENTER bgcolor='yellow'><B><I>")
}
else{
document.write("<td WIDTH=25 ALIGN=CENTER bgcolor='white'>")
}
if (week == tmpDay){
start = true
}
if ((start == true)&&(end == false)){
document.write(startDate)
startDate++
}
if (startDate == nowDate){
document.write("</B></I>")
}
document.write("</td>")
if (startDate > monthLen[nowMonth]){
end = true
}
}
document.write("</tr>")
}
document.write("</tr></table></td></tr></table>")
// -->
</SCRIPT> </BODY>
</HTML>
gracias
<HTML>
<HEAD>
<TITLE></TITLE>
</HEAD>
<BODY> <SCRIPT LANGUAGE="JavaScript">
<!--
now = new Date();
nowDay = now.getDay();
nowDate = now.getDate();
nowMonth = now.getMonth() + 1;
nowYear = new String(now.getYear());
nowyearLen = nowYear.length
nowYear = nowYear.split("")
nowYear = nowYear[nowyearLen - 2] + nowYear[nowyearLen - 1]
j = 31;
startDate = 1;
tmpDate = nowDate;
tmpDay = nowDay;
start = false;
end = false;
monthName = new Array();
monthName[1] = "January";
monthName[2] = "February";
monthName[3] = "March";
monthName[4] = "April";
monthName[5] = "May";
monthName[6] = "June";
monthName[7] = "July";
monthName[8] = "August";
monthName[9] = "September";
monthName[10] = "October";
monthName[11] = "November";
monthName[12] = "December";
monthLen = new Array();
monthLen[1] = "31";
monthLen[2] = "28";
monthLen[3] = "31";
monthLen[4] = "30";
monthLen[5] = "31";
monthLen[6] = "30";
monthLen[7] = "31";
monthLen[8] = "31";
monthLen[9] = "30";
monthLen[10] = "31";
monthLen[11] = "30";
monthLen[12] = "31";
for (i = 0; i < j; i++){
tmpDate--;
tmpDay--;
if (tmpDay < 0){
tmpDay = 6;
}
if (tmpDate == 1){
i = 31;
}
}
document.write("<table border=2 bgcolor='white'><tr><td><table><tr>")
document.write("<td WIDTH=211 ALIGN=CENTER>" + monthName[nowMonth] + ' ' + nowYear + "</td>")
document.write("</tr></table><table border=2><tr>")
document.write("<td WIDTH=25 ALIGN=CENTER>SU</td><td WIDTH=25 ALIGN=CENTER>M</td><td WIDTH=25 ALIGN=CENTER>T</td><td WIDTH=25 ALIGN=CENTER>W</td><td WIDTH=25 ALIGN=CENTER>TH</td><td WIDTH=25 ALIGN=CENTER>F</td><td WIDTH=25 ALIGN=CENTER>SA</td></tr><tr>")
for (i = 0; i < 7; i++){
for (week = 0; week <= 6; week++){
if (startDate == nowDate){
document.write("<td WIDTH=25 ALIGN=CENTER bgcolor='yellow'><B><I>")
}
else{
document.write("<td WIDTH=25 ALIGN=CENTER bgcolor='white'>")
}
if (week == tmpDay){
start = true
}
if ((start == true)&&(end == false)){
document.write(startDate)
startDate++
}
if (startDate == nowDate){
document.write("</B></I>")
}
document.write("</td>")
if (startDate > monthLen[nowMonth]){
end = true
}
}
document.write("</tr>")
}
document.write("</tr></table></td></tr></table>")
// -->
</SCRIPT> </BODY>
</HTML>
