diff --git a/rpr222/index.html b/rpr222/index.html index f783992..13ecb11 100644 --- a/rpr222/index.html +++ b/rpr222/index.html @@ -44,8 +44,8 @@
@@ -72,6 +72,7 @@
+
diff --git a/rpr222/main.js b/rpr222/main.js index ae553b1..64fe28d 100644 --- a/rpr222/main.js +++ b/rpr222/main.js @@ -44,7 +44,7 @@ function toggleDebug() { } function selectEvent(id) { - console.log(`inside selectEvent()`); +// console.log(`inside selectEvent()`); currentObject = id; array_counter = id; @@ -77,7 +77,7 @@ function selectEvent(id) { } function incArray() { - console.log("inside incArray"); +// console.log("inside incArray"); console.log(`array_counter = ${array_counter}`); console.log(`eventsLength = ${eventsLength}`); console.log(`events = ${events}`); @@ -88,7 +88,7 @@ function incArray() { } function decArray() { - console.log("inside decArray"); +// console.log("inside decArray"); console.log(`array_counter = ${array_counter}`); console.log(`eventsLength = ${eventsLength}`); console.log(`events = ${events}`); @@ -100,7 +100,7 @@ function decArray() { } function genList() { - console.log(`inside gen list `); +// console.log(`inside gen list `); list = ""; if (eventsLength > 15) { @@ -143,7 +143,7 @@ function main(array, dataLoad, aLen) { isEventsArray = Array.isArray(events); eventsLength = aLen; - console.log(`inside main`); +// console.log(`inside main`); console.log(`events = ${events}`); console.log(`dataLoad = ${dataLoad}`); console.log(`${isEventsArray}`); @@ -160,7 +160,7 @@ function main(array, dataLoad, aLen) { currentStart = currentDate; currentEnd = nextDate; nextStart = nextDate; - nextEnd = events[(nextObject + 1)].date; + nextEnd = events[(nextObject)].date; currentSubject = events[currentObject].subject; nextSubject = events[nextObject].subject; @@ -183,6 +183,42 @@ console.log(`nextDate = ${nextDate}`); // Update the count down every 1 second var x = setInterval(function() { + window.stopwatch++; + stopwatch = window.stopwatch; + +// console.log(stopwatch); + + swDays = Math.floor(stopwatch / (60 * 60 * 24)); + swHours = Math.floor((stopwatch % (60 * 60 * 24)) / (1000 * 60 * 60)); + swSeconds = Math.floor(stopwatch % (60)); + swMinutes = Math.floor(stopwatch / 60); +// swMinutes = Math.floor((nextDistance % (1000 * 60 * 60)) / (1000 * 60)); + if (swDays === 0) { + var swd = ''; + } else { + var swd = swDays + 'Days '; + } + + if (swHours < 10) { + var swh = '0' + swHours; + } else { + var swh = swHours; + } + + if (swMinutes < 10) { + var swm = '0' + swMinutes; + } else { + var swm = swMinutes; + } + + if (swSeconds < 10) { + var sws = '0' + swSeconds; + } else { + var sws = swSeconds; + } + + document.getElementById("stopwatch").innerHTML = swDays + swHours + ":" + swMinutes + ":" + swSeconds; + document.getElementById("meta").innerHTML = "Version: " + version + "
Debug: " + debug + ""; document.getElementById("events-list").innerHTML = genList(); @@ -355,4 +391,7 @@ function countdown(targetDate, nextDate, current) { return r; } - +function resetStopWatch() { + console.log("Reset Stopwatch"); + window.stopwatch = 0; +} diff --git a/rpr222/metadata.js b/rpr222/metadata.js index 3b2e6d9..ee1fcbf 100644 --- a/rpr222/metadata.js +++ b/rpr222/metadata.js @@ -1,4 +1,4 @@ -var version = "0.14.031" +var version = "0.14.032" var debug = false; var jsonUrl = 'https://api.myjson.com/bins/13hsch'; @@ -13,4 +13,4 @@ var initialized = false; var style = 'green'; var eventStyle = "events"; var array_counter = 0; - +window.stopwatch = 0;
EventTimeTime Until