scroll events out and add new on demand

This commit is contained in:
Kameron Kenny 2019-05-28 20:58:02 -04:00
parent a2c49fc0a4
commit 596b49f3b1
2 changed files with 13 additions and 30 deletions

View File

@ -1,29 +1,4 @@
var events = [
{
"date": "May 23, 2019 16:00:00",
"subject": "start",
"notes": ""
},
{
"date": "May 26, 2019 07:00:00",
"subject": "VTO",
"notes": "at Crosspoint"
},
{
"date": "May 26, 2019 13:00:00",
"subject": "Lunch",
"notes": "Something good."
},
{
"date": "May 27, 2019 00:00:01",
"subject": "Memorial Day",
"notes": ""
},
{
"date": "May 28, 2019 09:00:00",
"subject": "1:1 A",
"notes": ""
},
{
"date": "May 28, 2019 09:30:00",
"subject": "Team Meeting",

View File

@ -1,6 +1,6 @@
// meta
var version = "0.8.037"
var debug = true;
var version = "0.9.001"
var debug = false;
var style = 'green';
var eventStyle = "events";
@ -108,13 +108,18 @@ var x = setInterval(function() {
list = "<table class=events><th class=events>Event</th><th class=events>Time</th><th class=events>Time Until</th>";
if (aLen > 30) {
var listLength = 30;
if (eventsLength > 20) {
var listLength = 20;
var page = true;
} else {
var listLength = aLen;
var listLength = eventsLength;
}
var count_to_end = eventsLength - array_counter;
for (i = 0; i < listLength; i++) {
if (i === array_counter) {
eventStyle= "events-current";
} else {
@ -125,6 +130,9 @@ var x = setInterval(function() {
if (counter_diff < -2) {
list += '';
if (listLength < eventsLength) {
listLength++;
}
} else {
list += "<tr><td class=" + eventStyle + ">" + events[i].subject + "</td><td class=" + eventStyle + ">" + events[i].date + "</td><td class=" + eventStyle + ">" + countdown(events[i].date) + "</td></tr>";
}