Something is missing from my code, looking for helping spotting the issue. Open the lht_table.js file and below the comment section, declare a variable named thisDay containing the date October 1, 2021. You will use this date to test your script. Create a variable named tableHTML that will contain the HTML code of the events table. Add the text of the following HTML code to the initial value of the variable: Upcoming Events DateEventPrice Declare a variable named endDate that contains a Date object that is 14 days after the date stored in the thisDay variable. Use the new Date() object constructor and insert a time value that is equal to thisDay.getTime() + 14*24*60*60*1000. Create a for loop that loops through the length of the eventDates array. Use i as the counter variable. Within the for loop insert the following commands in a command block: Declare a variable named eventDate containing a Date object with the date stored in the ith entry in the eventDates array. Declare a variable named eventDay that stores the text of the eventDate date using the toDateString() method. Declare a variable named eventTime that stores the text of the eventDate time using the toLocaleTimeString() method. Insert an if statement that has a conditional expression that tests whether thisDay ≤ eventDateandeventDate ≤ endDate`. If so, the event falls within the two-week window that Lewis has requested and the script should add the following HTML code text to the value of the tableHTML variable. eventDay @ eventTime description price where eventDay is the value of the eventDay variable, eventTime is the value of the eventTime variable, description is the ith entry in the eventDescriptions array, and price is the ith entry in the eventPrices array. After the for loop, add the text of the HTML code to the value of the tableHTML variable. Insert the value of the tableHTML variable into the inner HTML of the page element with the ID eventList. Document your code in the script file using appropriate comments. Open the website in the browser preview. Verify that the page shows theater events over a two-week period starting with Friday, October 1, 2021 and concluding with Thursday, October 14, 2021. I have done the work, see below, I however cannot seem to understand why the table is not showing up. Any help would be apprciated. var thisDay = new Date("October 1, 2021"); var tableHTML = "" + "Upcoming Events" + "DateEventPrice"; var endDate = thisDay.getTime() + 14 * 24 * 60 * 60 * 1000; for(var i = 0; i < eventDate; i++) { var eventDate = new Date(eventDates[i]); var eventDay = eventDate.toDateString(); var eventTime = eventDate.toLocaleTimeString(); if(thisDay <= eventDate && eventDate <= endDate) { tableHTML = tableHTML + "" + eventDay + "@" + eventTime+ "" + eventDescriptions[i] + "" + eventPrices + ""; } } tableHTML = tableHTML + ""; document.getElementById("eventList").innerHTML = tableHTML;
Something is missing from my code, looking for helping spotting the issue.
Open the lht_table.js file and below the comment section, declare a variable named thisDay containing the date October 1, 2021. You will use this date to test your script. Create a variable named tableHTML that will contain the HTML code of the events table. Add the text of the following HTML code to the initial value of the variable:
<table id='eventTable'>
<caption>Upcoming Events</caption>
<tr><th>Date</th><th>Event</th><th>Price</th></tr>
Declare a variable named endDate that contains a Date object that is 14 days after the date stored in the thisDay variable.
Use the new Date() object constructor and insert a time value that is equal to thisDay.getTime() + 14*24*60*60*1000.
Create a for loop that loops through the length of the eventDates array. Use i as the counter variable.
Within the for loop insert the following commands in a command block:
- Declare a variable named eventDate containing a Date object with the date stored in the ith entry in the eventDates array.
- Declare a variable named eventDay that stores the text of the eventDate date using the toDateString() method.
- Declare a variable named eventTime that stores the text of the eventDate time using the toLocaleTimeString() method.
- Insert an if statement that has a conditional expression that tests whether thisDay ≤ eventDateandeventDate ≤ endDate`. If so, the event falls within the two-week window that Lewis has requested and the script should add the following HTML code text to the value of the tableHTML variable. <tr> <td>eventDay @ eventTime</td> <td>description</td> <td>price</td> </tr> where eventDay is the value of the eventDay variable, eventTime is the value of the eventTime variable, description is the ith entry in the eventDescriptions array, and price is the ith entry in the eventPrices array.
After the for loop, add the text of the HTML code </table> to the value of the tableHTML variable. Insert the value of the tableHTML variable into the inner HTML of the page element with the ID eventList.
Document your code in the script file using appropriate comments. Open the website in the browser preview. Verify that the page shows theater events over a two-week period starting with Friday, October 1, 2021 and concluding with Thursday, October 14, 2021.
I have done the work, see below, I however cannot seem to understand why the table is not showing up. Any help would be apprciated.
var thisDay = new Date("October 1, 2021");
var tableHTML = "<table id='eventTable'>" + "<caption>Upcoming Events</caption>" + "<tr><th>Date</th><th>Event</th><th>Price</th></tr>";
var endDate = thisDay.getTime() + 14 * 24 * 60 * 60 * 1000;
for(var i = 0; i < eventDate; i++) {
var eventDate = new Date(eventDates[i]);
var eventDay = eventDate.toDateString();
var eventTime = eventDate.toLocaleTimeString();
if(thisDay <= eventDate && eventDate <= endDate) {
tableHTML = tableHTML + "<tr><td>" + eventDay + "@" + eventTime+ "</td><td>" + eventDescriptions[i] + "</td><td>" + eventPrices + "</td></tr>";
}
}
tableHTML = tableHTML + "</table>";
document.getElementById("eventList").innerHTML = tableHTML;
![The
Lyman Hall Theater
home
events
box office facilities
directions
contact
At the Theater
Upcoming Events
Great shows are coming to the Lyman Hal Theater in the
upcoming weeks. The Broadway Touring Company of Cabaret
arrives for four performances, featuring Tony-award winning
actress Kayla James. Tickets are limted, so be sure to gder
online or by calling the LHT boxoffice.
Date
Event
Price
Fri Oct 01 2021 7:30:00 PH
Have Spacesult, Wil Travel
$22/136/s48
Sat Oct 02 2021 7:00:00 PM
Cabaret
$48/S64/S88
Sun Oct 03 2021 e 11:00:00 AM
Classics Brunch
$12
Enjoy a stunning multimedia event with Edward Lee's Vsns
Tue Oct 0s 2021 G 7:00:00 PM
Visions of Light and Dreams
$18/532
Laht and Dreams featuring sound, video, and interactive
demonstrations of the latest innovations in film and theater.
wd oct 06 2021 7:00:00 P
San Diego Blues
$24/$35
Thu Oct 07 2021 0 7:00:00 PH
Cabarut
$48/$64/$88
If music is more your passion, LHT welcomes the popular
group San Dielues Want an evening of laughs? Get your
tickets now for Gerny Jones and his one-person show, Ext
Stage Let.
Fri Oct 08 2021 7:00:00 PH
Cabaret
Sat Oct 09 2021 7:00:00 PH
Cabaret
$48/S64/SBB
Sun Oct 10 2021 1:00:00 AM
Classics Brunch
$12
For an inexpensive night out, be sure to check out LT's
Classic Onema. For a delicious Sunday brunch, jon us for
Classics Brunch.
Mon Oct 11 20217:0000 H
Classic Cinema: Safety first
$12
wwd oct 13 20218:00:00 P
Est Stage Left
$18/528/S35
Thu Oct 14 2021 O 8:00:00 PH
Antonio Perez
$32/s48/564
The Lyman Hal Theater
Bo Oie
Gre at
Staff
414 Leward Drive
Employment Into
Braokhaven, GA 309
Events
Directions a Parking
offce (4) 5s-4140](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Fa9dcdc3c-6dc3-477b-85c7-36dea293e258%2F4fde9caf-fd0f-4e80-839e-88219e84b7f6%2Fvm1w1j_processed.png&w=3840&q=75)
![Page
Filesystem
Iht table.js*
>
Iht_list.js
O top
1 "use strict";
O deluxe-blenny-9xnu-8080.nt.run
3 /1
Iht_events.html
4
5 */
6 var thisDay = new Date("october 1, 2021");
7 var tableHTML = "<table id='eventTable'>" + "<caption>Upcoming Event
8 var endDate = thisDay.getTime() + 14 * 24 * 60 * 60 * 1000
Iht_list.js
The
*Iht_table.js
Iht events.css
9
Lyman Hall Theater
10 for (var i = 0; i « eventDate; i++) {
var eventDate = new Date(eventDates[i]);
var eventday = eventDate.toDatestring();
var eventtime = eventDate.toLocaleTimestring();
if(thisDay <= eventDate && eventdate <= endDate) {
tableHTML = tableHTML + "<tr><td>" + eventDay + "e" + eventTime+
}
17 }
18 tableHTML = tableHTML + "</table>";
19 document.getelementById ("eventlist").innerHTML = tableHTML;
Iht_reset.css
11
Iht_styles.css
12
Iht_logo2.png
13
14
Iht_navicon2.png
home
box office
facilities
directions
contact
events
15
16
At the Theater
20
Upcoming Events
Price
Great shows are coming to the Lyman Hall Theater in the
upcoming weeks. The Broadway Touring Company of Cabaret
Date
Event
arrives for four performances, featuring Tony-award winning
actress Kayla James. Tickets are limited, so be sure to order
online or by calling the LHT boxoffice.
Enjoy a stunning multimedia event with Edward Lee's Visions
of Light and Dreams featuring sound, video, and interactive
demonstrations of the latest innovations in film and theater.
If music is more your passion, LHT welcomes the popular
group San Diego Blues. Want an evening of laughs? Get your
tickets now for Gerry Jones and his one-person show, Exit
Stage Left.
For an inexpensive night out, be sure to check out LHT's
Classic Cinema. For a delicious Sunday brunch, join us for
Classics Brunch.
The Lyman Hall Theater
Box Office
Staff
414 Leeward Drive
Group Rates
Employment Info
{} Line 3, Column 3 Coverage: n/a](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Fa9dcdc3c-6dc3-477b-85c7-36dea293e258%2F4fde9caf-fd0f-4e80-839e-88219e84b7f6%2F6cy0lpk_processed.jpeg&w=3840&q=75)
![](/static/compass_v2/shared-icons/check-mark.png)
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![C How to Program (8th Edition)](https://www.bartleby.com/isbn_cover_images/9780133976892/9780133976892_smallCoverImage.gif)
![Database Systems: Design, Implementation, & Manag…](https://www.bartleby.com/isbn_cover_images/9781337627900/9781337627900_smallCoverImage.gif)
![Programmable Logic Controllers](https://www.bartleby.com/isbn_cover_images/9780073373843/9780073373843_smallCoverImage.gif)