I have the following, but not sure why it isn’t picking up this year as a leap year. Any idea?
CalendarMonth.prototype.correctForLeapYear = function()
{
if(this.year%4 != 0)
{
daysInMonth[1] = 28;
this.isLeapYear = 0;
}
else if(this.year%400 == 0)
{
daysInMonth[1] = 29;
this.isLeapYear = 1;
}
else if(this.year%100 == 0)
{
daysInMonth[1] = 28;
this.isLeapYear = 0;
}
else
{
daysInMonth[1] = 29;
this.isLeapYear = 1;
}
}
Thanks
Martin