From 25b9ac168db88e2bb517a3670e4a00738440e92f Mon Sep 17 00:00:00 2001 From: jtbx Date: Thu, 8 Feb 2024 19:52:29 +0100 Subject: [PATCH] fetch-calendar: set start time to 6 h in the past Only showing the current event if it started less than 6 hours in the past should be fine. We rarely have longer events and those usually had an announcement post anyways. --- fetch-calendar.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fetch-calendar.sh b/fetch-calendar.sh index 62cad68..bbfd37e 100755 --- a/fetch-calendar.sh +++ b/fetch-calendar.sh @@ -7,10 +7,10 @@ OUTFILE=data/calendar.json # See here for uname -s outputs: https://en.wikipedia.org/wiki/Uname#Examples OS_TYPE=$(uname -s) if [ "$OS_TYPE" = "Linux" ]; then - START_TIME=$(date --date="-1 day" +%s) # yesterday + START_TIME=$(date --date="-6 hours" +%s) # now - 6 hours END_TIME=$(date --date="+1 month" +%s) # now + 1 month elif [ "$OS_TYPE" = "Darwin" ] || [ "$OS_TYPE" = "FreeBSD" ]; then - START_TIME=$(date -v-1d +%s) # yesterday + START_TIME=$(date -v-6H +%s) # now - 6 hours END_TIME=$(date -v+1m +%s) # now + 1 month else echo "ERROR: Unsupported OS type" -- 2.44.1