Java-Sript Calendar
Try This One Too.
<script language = javascript> var Today=new Date(); var ThisDay=Today.getDay(); // a number between 0 and 6 represent the weekday var ThisDate=Today.getDate(); //day number between 0 and 31 var ThisMonth=Today.getMonth()+1; //month number between 0 and 12 function DayTxt (DayNumber) { var Day=new Array(); Day[0]="Sunday"; Day[1]="Monday"; Day[2]="Tuesday"; Day[3]="Wednesday"; Day[4]="Thursday"; Day[5]="Friday"; Day[6]="Saturday"; return Day[DayNumber]; } var DayName=DayTxt(ThisDay); function MonthTxt (MonthNumber) { var Month=new Array(); Month[1]="January"; Month[2]="February"; Month[3]="March"; Month[4]="April"; Month[5]="May"; Month[6]="June"; Month[7]="July"; Month[8]="August"; Month[9]="September"; Month[10]="October"; Month[11]="November"; Month[12]="December"; return Month[MonthNumber]; } var MonthName=MonthTxt(ThisMonth); document.write("<center><TABLE BORDER=3 BGCOLOR=WHITE WIDTH=75 HEIGHT=85><tr><TD align=center><font size=-2 >"+DayName+"<br><font color=orangered size=+3 >"+ThisDate+"</font><br>"+MonthName+"<br></b></font></TD></TR></TABLE>"); </script>
This one's cool w/ time
<center><SCRIPT LANGUAGE="JavaScript"> <!-- setCal() function getTime() { // initialize time-related variables with current time settings var now = new Date() var hour = now.getHours() var minute = now.getMinutes() now = null var ampm = "" // validate hour values and set value of ampm if (hour >= 12) { hour -= 12 ampm = "PM" } else ampm = "AM" hour = (hour == 0) ? 12 : hour // add zero digit to a one digit minute if (minute < 10) minute = "0" + minute // do not parse this number! // return time string return hour + ":" + minute + " " + ampm } function leapYear(year) { if (year % 4 == 0) // basic rule return true // is leap year /* else */ // else not needed when statement is "return" return false // is not leap year } function getDays(month, year) { // create array to hold number of days in each month var ar = new Array(12) ar[0] = 31 // January ar[1] = (leapYear(year)) ? 29 : 28 // February ar[2] = 31 // March ar[3] = 30 // April ar[4] = 31 // May ar[5] = 30 // June ar[6] = 31 // July ar[7] = 31 // August ar[8] = 30 // September ar[9] = 31 // October ar[10] = 30 // November ar[11] = 31 // December // return number of days in the specified month (parameter) return ar[month] } function getMonthName(month) { // create array to hold name of each month var ar = new Array(12) ar[0] = "January" ar[1] = "February" ar[2] = "March" ar[3] = "April" ar[4] = "May" ar[5] = "June" ar[6] = "July" ar[7] = "August" ar[8] = "September" ar[9] = "October" ar[10] = "November" ar[11] = "December" // return name of specified month (parameter) return ar[month] } function setCal() { // standard time attributes var now = new Date() var year = now.getYear() var month = now.getMonth() var monthName = getMonthName(month) var date = now.getDate() now = null // create instance of first day of month, and extract the day on which it occurs var firstDayInstance = new Date(year, month, 1) var firstDay = firstDayInstance.getDay() firstDayInstance = null // number of days in current month var days = getDays(month, year) // call function to draw calendar drawCal(firstDay + 1, days, date, monthName, 0 + year) } function drawCal(firstDay, lastDate, date, monthName, year) { // constant table settings var headerHeight = 15 // height of the table's header cell var border = 0 // 3D height of table's border var cellspacing = 0 // width of table's border var headerColor = "white" // color of table's header var headerSize = "1" // size of tables header font var colWidth = 30 // width of columns in table var dayCellHeight = 10 // height of cells containing days of the week var dayColor = "white" // color of font representing week days var cellHeight = 20 // height of cells representing dates in the calendar var todayColor = "red" // color specifying today's date in the calendar var timeColor = "red" // color of font representing current time // create basic table structure var text = "" // initialize accumulative variable to empty string text += '<TABLE BORDER=' + border + 'cellpadding="0" cellspacing="0"bgcolor="#000080" bordercolor="#FFFFFF">' // table settings text += '<TH COLSPAN=7 HEIGHT=' + headerHeight + '>' // create table header cell text += '<FONT COLOR="' + headerColor + '" SIZE=' + headerSize + '>' // set font for table header text += monthName + ' ' + year text += '</FONT>' // close table header's font settings text += '</TH>' // close header cell // variables to hold constant settings var openCol = '<TD WIDTH=' + colWidth + ' HEIGHT=' + dayCellHeight + '>' openCol += '<FONT COLOR="' + dayColor + '">' var closeCol = '</FONT></TD>' // create array of abbreviated day names var weekDay = new Array(7) weekDay[0] = "Sun" weekDay[1] = "Mon" weekDay[2] = "Tue" weekDay[3] = "Wed" weekDay[4] = "Thur" weekDay[5] = "Fri" weekDay[6] = "Sat" // create first row of table to set column width and specify week day text += '<TR ALIGN="center" VALIGN="center">' for (var dayNum = 0; dayNum < 7; ++dayNum) { text += openCol + weekDay[dayNum] + closeCol } text += '</TR>' // declaration and initialization of two variables to help with tables var digit = 1 var curCell = 1 for (var row = 1; row <= Math.ceil((lastDate + firstDay - 1) / 7); ++row) { text += '<TR ALIGN="right" VALIGN="top">' for (var col = 1; col <= 7; ++col) { if (digit > lastDate) break if (curCell < firstDay) { text += '<TD></TD>' curCell++ } else { if (digit == date) { // current cell represent today's date text += '<TD HEIGHT=' + cellHeight + '>' text += '<FONT COLOR="' + todayColor + '" SIZE="-1"><b>' text += digit text += '</FONT></b>' text += '<BR>' text += '<i><FONT COLOR="' + timeColor + '" SIZE="-1">' text += '<CENTER>' + getTime() + '</CENTER>' text += '</FONT></i>' text += '</TD>' } else text += '<TD HEIGHT=' + cellHeight + '><b><font size="-1" color=white>' + digit + '</font></b></TD>' digit++ } } text += '</TR>' } // close all basic table tags text += '</TABLE>' // print accumulative HTML string document.write(text) } // --> </SCRIPT> </center>
Now try this cool Calander....
<script language="JavaScript"> <!-- function getmonth(themonth0, themonth1, themonth2, themonth3, themonth4, themonth5, themonth6, themonth7, themonth8, themonth9, themonth10, themonth11) { this[0] = themonth0; this[1] = themonth1; this[2] = themonth2; this[3] = themonth3; this[4] = themonth4; this[5] = themonth5; this[6] = themonth6; this[7] = themonth7; this[8] = themonth8; this[9] = themonth9; this[10] = themonth10; this[11] = themonth11; } function makecalendar() { var whatIsIt = "JanFebMarAprMayJunJulAugSepOctNovDec"; var today = new Date(); var thisDay; var monthDays = new getmonth(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31); year=today.getFullYear(); thisDay = today.getDate(); if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)) monthDays[1] = 29; nDays = monthDays[today.getMonth()]; IsitNow = today; IsitNow.setDate(1); FindOut = IsitNow.getDate(); if (FindOut == 2) IsitNow.setDate(0); startDay = IsitNow.getDay(); document.write("<table border=0 width=200 bgcolor=#000080>"); document.write("<tr><td colspan=7 align=center><font color=#FFFFFF><b>"); document.write(whatIsIt.substring(today.getMonth() * 3, (today.getMonth() + 1) * 3)); document.write(" "); document.write(year); document.write("</b></font></td></tr><tr><td align=center><font color=white><b>Sun</b></font></td><td align=center><font color=white><b>Mon</b></font></td><td align=center><font color=white><b>Tue</b></font></td><td align=center><font color=white><b>Wed</b></font></td><td align=center><font color=white><b>Thu</b></font></td><td align=center><font color=white><b>Fri</b></font></td><td align=center><font color=white><b>Sat</b></font></td></tr>"); document.write("<tr>"); column = 0; for (i=0; i<startDay; i++) { document.write("<td width=35 bgcolor=#000080> "); column++; } for (i=1; i<=nDays; i++) { document.write("</td><td width=35 bgcolor=#000080><font color=white>"); if (i == thisDay) document.write("<font color=\"#FF0000>\"><b>") document.write(i); if (i == thisDay) document.write("</b></font>") column++; if (column == 7) { document.write("</td></tr><tr>"); column = 0; } } document.write("</tr></table>"); } makecalendar(); // --> </script>