HTML and CSS Reference
In-Depth Information
Figure 12-30
adding the datestring parameter
if no date is is
pecified,
the current date is used
◗
3.
Save your changes to the file, and then reload
ccc.htm
in your Web browser.
Verify that the calendar for the current month and date appears at the top of the
Web page.
◗
4.
Open the
ccc.htm
file in your text editor, and then change the statement that
runs the monthly calendar to the following, as shown in Figure 12-31:
calendar(“July 6, 2015”);
Figure 12-31
Displaying the calendar for july 6, 2015
displays the
monthly calendar
for July 6, 2015
◗
5.
Save your changes to the file, and then reload
ccc.htm
in your Web browser.
Verify that the monthly calendar for July 6, 2015 appears in the Web page.
Display Daily Events
The final piece of your calendar app is to display the daily events in July. Maria already
has created an array of daily event text, part of which is shown in Figure 12-32.
Figure 12-32
the dayevent array of events
The
dayEvent
array has 31 items to match the 31 days in July. Array items that match
days on which no event is scheduled contain a blank text string, while daily events are
written in the HTML code that will be inserted into the calendar table. To display this
content, you'll create a link to the
events.js
file; and then within the writeCalDays() func-
tion, you'll add an expression to write the contents of the
dayEvent
array into the indi-
vidual table cells.