
09/07/2009, 10:36
|
| | Fecha de Ingreso: mayo-2005
Mensajes: 26
Antigüedad: 19 años, 10 meses Puntos: 0 | |
Respuesta: Generador de Mes en Calendario Les pongo estos códigos que tienen que ver con el código anterior
Código:
// Build the row that contains the day names
function columnHeaders()
{
var result = "";
var weekStart = document.CalendarSettings.WeekStart.value;
var weekHead2 = "</font></H2></center><TABLE width=\"100%\" border=1 bordercolordark=\"#000000\" bordercolorlight=\"#FFFFFF\" cellpadding=\"5\">" + "\n" + "<TBODY><TR>";
var weekHead3 = "<TH valign=center align=middle width=\"14%\" bgcolor=\"#000000\"><font size=\"1\" color=\"#FFFFFF\" face=\"Verdana\">"+"\n";
var weekHead4 = "</font></TH>";
result += weekHead2;
var currday;
for(var day = 1; day <= 8; day++)
{
result += weekHead3;
currday = day + (weekStart - 1);
// determine whether to use long or short day names
if (document.CalendarSettings.names[1].checked)
{
result += daysOfWeekShort[currday];
}
else
{
result += daysOfWeekLong[currday];
}
result += weekHead4;
}
result += "</TR><TR>";
return result;
}
// Determine the number of days in the month and the starting/ending dates
function createMonth(inputMonth, inputYear, inputDay)
{
var leapYear = false;
monthName = months[inputMonth];
newMonth = inputMonth;
newYear = inputYear;
yearName = inputYear.toString();
cellsHTML = "";
numBlankDays = inputDay;
//figure out if the year is a leap year
if(inputYear%4 == 0)
{
if(inputYear%100 != 0)
{
leapYear = true;
}
else
{
if(inputYear%400 == 0)
leapYear = true;
else
leapYear = false;
}
}
//figure out the number of days in the month
//if month is NOT february, april, june, september, nor november then it has 31 days
if(inputMonth != 2 && inputMonth != 4 && inputMonth != 6 && inputMonth != 9 && inputMonth != 11)
{
numberOfDays = 31;
}
else
{
//if month is NOT february, then it has 30 days
if(inputMonth != 2)
{
numberOfDays = 30;
}
else
{
//if month is a leap year, then it has 29 days. if not, it has 28
if(leapYear)
{
numberOfDays = 29;
}
else
{
numberOfDays = 28;
}
}
}
postDay = (numberOfDays + numBlankDays) % 7; // day after end of month
}
Después de estos 2 códigos viene el getmonth();
Gracias de nuevo! |