Template:Team:Uppsala/JS/notebook
From 2013.igem.org
<script type="text/javascript"> var month = new Date().getMonth(); var year = new Date().getFullYear(); var cal_table = ; var days_in_month = new Array(31,28,31,30,31,30,31,31,30,31,30,31);
Date.prototype.getWeek = function() {
var onejan = new Date(this.getFullYear(),0,1); return Math.ceil((((this - onejan) / 86400000) + onejan.getDay()+1)/7);
}
function calendar() {
var m = month+1; var date = new Date(); var today = date.getDate(); cal_table = ;
if(year<=200) { year += 1900; } months = new Array('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'); var weekDay = new Array('Mon', 'Tue', 'We', 'Thu', 'Fri', 'Sat', 'Sun'); days_in_month = new Array(31,28,31,30,31,30,31,31,30,31,30,31); if(year%4 == 0 && year!=1900) { days_in_month[1]=29; } total = days_in_month[month]; var date_today = months[month]+' '+year;cal_table = cal_table + '
<input id="left" type="image" onclick="left_arrow()" src="image/buttons/arrowleft.png"> | '+date_today+' | <input id="right" type="image" onclick="right_arrow()" src="image/buttons/arrowright.png"> | |||||
---|---|---|---|---|---|---|---|
Mon | Tue | Wed | Thu | Fri | Sat | Sun | Week |
'; | |||||||
<input type="submit" onclick="" value="'+i+'"> | ';<input type="submit" onclick="" value="'+i+'"> | ';<input type="submit" onclick="" value="'+weeknr+'"> | '; cal_table = cal_table + ''; | <input type="submit" onclick="" value="'+weeknr+'"> | ';
}
</script>