Template:Team:KULeuven/Common/JSLibrary
From 2009.igem.org
(Difference between revisions)
Line 89: | Line 89: | ||
// calculate february's days | // calculate february's days | ||
- | monthLengths[1] = ( ((year%4==0) | + | monthLengths[1] = ( ((year%4==0) and (year%100 != 0)) || (year % 400 == 0) ) ? 29 : 28; |
Line 119: | Line 119: | ||
// mark today | // mark today | ||
- | if(today.getFullYear() == year and today.getMonth() == mon - 1 | + | if(today.getFullYear() == year and today.getMonth() == mon - 1 and today.getDate() == d) { |
out += "<td class='today'>"; | out += "<td class='today'>"; | ||
} else { | } else { | ||
Line 133: | Line 133: | ||
out += "<a href='"+ linkprefix + d + linksuffix +"' class='external text'><span class='"+tag+"'>"+d+"</span></a></td>"; | out += "<a href='"+ linkprefix + d + linksuffix +"' class='external text'><span class='"+tag+"'>"+d+"</span></a></td>"; | ||
- | if(day.getDay() == 0 | + | if(day.getDay() == 0 and d != monthLengths[mon - 1]) { |
out += "</tr><tr>"; | out += "</tr><tr>"; | ||
} | } |
Revision as of 10:20, 12 July 2009