
| <HTML> <HEAD> <TITLE>Calendar</TITLE> <SCRIPT> /********** DECLARE ARRAYS & DATE OBJECT **********/ var dayName
= new Array ("Sunday", "Monday",
"Tuesday", "Wednesday", var Month30
= new Array(3, 5, 8, 10); // months
containing 30 days var now = new Date(); var Month = now.getMonth(); /********** END OF DECLARING ARRAYS & DATE OBJECT **********/ /********** GET FIRST DAY OF MONTH **********/ var strDate = new Date(Year, Month, 1); // set Date for the 1st of the selected Month var firstDay = strDate.getDay(); // get the "Day" of the 1st Day of the selected Month /********** END OF GET FIRST DAY OF MONTH **********/ /********** GET THE NUMBER OF DAYS IN THE MONTH **********/ function getDaysInMonth(Year,
Month) { /* for
(variable in [object | array]) NOTE: The for-in works in
browsers 4.x or greater //
-- OR -- for browsers that don't understand for-in // Checking to
see if the Month has 31 days var daysInMonth = getDaysInMonth(Year, Month); // gives us the number of days in the Month /********** END OF GET THE NUMBER OF DAYS IN THE MONTH **********/ </SCRIPT> </HEAD> <BODY> <SCRIPT> /********** WRITE OUT MONTH & YEAR **********/ document.write(monthName[Month] + " " + Year); // write Month & Year /********** END OF WRITE OUT MONTH & YEAR **********/ </SCRIPT> <TABLE> <SCRIPT> /********** TABLE HEADER **********/ // Create Table
Headers (Sunday, Monday, etc..., Saturday) document.write("</TR><TR>"); /********** END OF TABLE HEADER **********/ /********** BODY OF THE TABLE **********/ var column = firstDay; //
first day of the Month // fill up the
Beginning of the Month to the 1st of the Month with Blank Cells for (i = 0; i < daysInMonth) { // fill up the End
of the Month after the Last of the Month with Blank Cells /********** END OF BODY OF THE TABLE **********/ </SCRIPT> </TR></TABLE> </CENTER> </BODY> |