From 34769b70bf71ae97a7b73b3e316bb77ae0a6a8da Mon Sep 17 00:00:00 2001 From: Jamie Orlando <129876817+jorlando-tuik@users.noreply.github.com> Date: Mon, 22 Jan 2024 10:42:25 -0500 Subject: [PATCH 1/2] Expanding RRule to include 2024 Expanding RRule configuration to include events in 2024 --- index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.ts b/index.ts index 07c7771b..e123d8ac 100644 --- a/index.ts +++ b/index.ts @@ -178,7 +178,7 @@ function rawParser(rawData) { } else { const dates = event.rrule.between( new Date(2021, 0, 1, 0, 0, 0, 0), - new Date(2023, 11, 31, 0, 0, 0, 0) + new Date(2024, 11, 31, 0, 0, 0, 0) ); console.log(dates); if (dates.length === 0) continue; From 6979200fb1316cff9a595149e5bc33fcd1324329 Mon Sep 17 00:00:00 2001 From: Jamie Orlando <129876817+jorlando-tuik@users.noreply.github.com> Date: Mon, 22 Jan 2024 10:49:28 -0500 Subject: [PATCH 2/2] getting year dynamically avoid a PR every year and get the current year dynamically from the system clock --- index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.ts b/index.ts index e123d8ac..c2a2386b 100644 --- a/index.ts +++ b/index.ts @@ -176,9 +176,10 @@ function rawParser(rawData) { //@ts-expect-error eventsArray.push(rawDataV2[dataValue]); //simplifying results, credits to https://github.com/muness/obsidian-ics for this implementations } else { + const currentYear = new Date().getFullYear() const dates = event.rrule.between( new Date(2021, 0, 1, 0, 0, 0, 0), - new Date(2024, 11, 31, 0, 0, 0, 0) + new Date(currentYear, 11, 31, 0, 0, 0, 0) ); console.log(dates); if (dates.length === 0) continue;