From e5abfffa48db51a8e83addccc182cf2737119644 Mon Sep 17 00:00:00 2001 From: TabascoEye Date: Tue, 11 Jan 2022 11:42:06 +0100 Subject: [PATCH 1/2] trying simple way of only showing upcoming events on first call of the webpage, only upcoming events shall be shown, when changing the month "prev/next" and even when coming back to the current month, ALL events shall be shown --- app/scripts/events.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/scripts/events.js b/app/scripts/events.js index 627e0df1..8e6430af 100644 --- a/app/scripts/events.js +++ b/app/scripts/events.js @@ -11,6 +11,7 @@ } var firstRun = true; + var notCurrentmonth = false; var loadEvents; loadEvents = function() { if (firstRun) { firstRun = !firstRun; @@ -25,9 +26,14 @@ if (trymonth.isValid()) { month = trymonth.startOf('month'); } + notCurrentmonth = true; } - var monthStart = month.startOf('month').format('X'); + if (notCurrentmonth) { + var monthStart = month.startOf('month').format('X'); + } else { + var monthStart = month.startOf('day').format('X'); + } var monthEnd = month.endOf('month').format('X'); var prevMonth = month.subtract(1, 'months').format('YYYY-MM'); var nextMonth = month.add(2, 'months').format('YYYY-MM'); From fcd2617cc7bd82b2f997cdbde71be6c0be37ec20 Mon Sep 17 00:00:00 2001 From: TabascoEye Date: Tue, 11 Jan 2022 11:46:37 +0100 Subject: [PATCH 2/2] Update events.js --- app/scripts/events.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/scripts/events.js b/app/scripts/events.js index 8e6430af..1e99b63d 100644 --- a/app/scripts/events.js +++ b/app/scripts/events.js @@ -32,7 +32,7 @@ if (notCurrentmonth) { var monthStart = month.startOf('month').format('X'); } else { - var monthStart = month.startOf('day').format('X'); + var monthStart = moment().startOf('day').format('X'); } var monthEnd = month.endOf('month').format('X'); var prevMonth = month.subtract(1, 'months').format('YYYY-MM');