|
Date Functions?
Date: 05/05/05
(Web Development) Keywords: css, html, web
I need help with creating a calendar in css, can someone help me out.
This is what I have to do:
1. I have to create a new blank file and save it as caldendar.js
2. Then within the file, I am supposed to insert a function named calendar() that has a single parameter named "caldate". The caldate parameter stores the date the user wants hightlighted in the calendar.
3. Within the command block of the calendar() function, I am to create an array named "MonthName" that stores the names of the twelve months. Th first element in the array, MonthName[0] should have a value of "January" and completes the rest of the array similarly.
4. Then I am to create an array, "DayName", that stores the three letter abbreviations of the seven weekday names, starting with DayName[0] ="Sun".
5. After the DayName array, I am to create a date object variable named Calendar_Day. If the value of the caldate parameter is equal to "today", set Calendar_Day equal to the current date and time; otherwise, set Calendar_Day equal to the date specified by the caldate parameter. (Hint: use the command: Calendar_Day = new Date(caldate)).
6. Use the getDate(), getMonth(), and getFullYear() methods to extract the day of the month, month number, and four-digit year from the Calendar_Day variable. Store these values in variables named ThisDay, ThisMonth, and ThisYear, respectively.
7. Then I am to use the doucment.write() method to write the following tags to the Web page:
|