From 334550675a59d43694a2e071f1aba08ba09d4924 Mon Sep 17 00:00:00 2001 From: Ben Schumacher Date: Thu, 3 Nov 2022 13:14:43 +0100 Subject: [PATCH] Add nextWeek template variable (#109) --- plugs/core/template.ts | 5 +++++ website/🔌 Core.md | 1 + 2 files changed, 6 insertions(+) diff --git a/plugs/core/template.ts b/plugs/core/template.ts index d717377..a6edd17 100644 --- a/plugs/core/template.ts +++ b/plugs/core/template.ts @@ -105,6 +105,11 @@ export function replaceTemplateVars(s: string, pageName: string): string { lastWeek.setDate(lastWeek.getDate() - 7); return niceDate(lastWeek); } + case "nextWeek": { + const nextWeek = new Date(); + nextWeek.setDate(nextWeek.getDate() + 7); + return niceDate(nextWeek); + } case "page": return pageName; } diff --git a/website/🔌 Core.md b/website/🔌 Core.md index 8e3261a..3a9193e 100644 --- a/website/🔌 Core.md +++ b/website/🔌 Core.md @@ -84,4 +84,5 @@ Currently supported (hardcoded in the code): - `{{tomorrow}}`: Tomorrow’s date in the usual YYY-MM-DD format - `{{yesterday}}`: Yesterday’s date in the usual YYY-MM-DD format - `{{lastWeek}}`: Current date - 7 days +- `{{nextWeek}}`: Current date + 7 days - `{{page}}`: The name of the current page