Question: Javascript issues! I can post my html, js, and 2 css files below. I cannot figure out how to make the page show the date
Javascript issues!
I can post my html, js, and 2 css files below. I cannot figure out how to make the page show the date and time of may 19, 2018 at 9:31:27 am,. and that the countdown clock on the bottom shows that summer party fireworks will behin in 46 days, 11 hours, 28 minutes, and 33 seconds.I dont want the date to coutn down, just for it to display the fixed date and time for the thisDay variable.
HTML FILE
Tulsa's Summer Party
Countdown to the Fireworks
58 Days
10 Hrs
14 Mins
48 Secs
Celebrate the nation's birthday at Tulsa's Summer Party, a daylong extravaganza in downtown Tulsa on the 4th of July. The festivities start at 9 a.m. with a 5K and 10K walk or race. A great event for the whole family. Sign up as an individual or part of a team.
The Farmer's Market is also back with farm-fresh produce, meats, and dairy. There's something for every pallet.
Live music starts at 11 a.m. and continues through the day with special appearances from Falstaff Ergo, Crop Circles, Prairie Wind and James Po.
At 9 p.m. enjoy the fireworks that have won awards as the best in the Midwest, designed and presented by Wizard Works. Arrive early for the best seats!
After the show, dance the night away to the music of the Chromotones.
See you on the 4th!
JAVASCRIPT FILE
"use strict"; /* filename: tny_timer.js
*/ nextJuly4(); setInterval()
/* declare the variables for time/date */
function showClock() { var thisDay = new Date("May 19, 2018 09:31:27"); var localDate = thisDay.toLocaleDateString(); var localTime = thisDay.toLocalTimeString();
/* show the date and time*/ document.getElementById("currentTime").innerHTML = localDate + " " + localTime; /*Get hours left*/ var hLeft = (hLeft - Math.floor(hLeft))*24; /*get minutes/seconds left*/ var mLeft = (mLeft - Math.floor(mLeft))*24; var sLeft = (mLeft - Math.floor(mLeft))*24; /*time till newyears eve*/ document.getElementById("dLeft").textContent = "dd"; document.getElementById("hLeft").textContent = "hh"; document.getElementById("mLeft").textContent = "mm"; document.getElementById("sLeft").textContent = "ss"; }
function nextJuly4(thisDay) { var cYear = currentDate.getFullYear(); var jDate = new Date("July 4, 2018"); jDate.setFullYear(cYear); if ((jDate - currentDate)
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
Students Have Also Explored These Related Databases Questions!