From ecd4020a247b71ac46ff665d59645455ea90f71e Mon Sep 17 00:00:00 2001 From: w35l3y Date: Mon, 30 Dec 2024 15:10:03 -0300 Subject: [PATCH] Dynamic year This should fix #147, #201 and #217 --- src/util/i18n.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/util/i18n.ts b/src/util/i18n.ts index 3ad4258..3d73d9e 100644 --- a/src/util/i18n.ts +++ b/src/util/i18n.ts @@ -25,7 +25,11 @@ const enhance11tydata = ( // TODO: do we need to use the locale? it defaults to gregorian calendar, // which is probably wrong in many cases. or is it "normal" by now? - obj.currentYear = new Date().getFullYear().toString(10); + Object.defineProperty(obj, "currentYear", { + get () { + return new Date().getFullYear().toString(10); + } + }); return obj; };