From 1ef52d30f1307afc9ecbdc17c6a048baea38a39f Mon Sep 17 00:00:00 2001 From: lauralani Date: Sun, 4 Jun 2023 20:27:58 +0200 Subject: [PATCH] try year filter again --- .eleventy.js | 5 +++-- index.njk | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.eleventy.js b/.eleventy.js index d4c4457..68163ab 100644 --- a/.eleventy.js +++ b/.eleventy.js @@ -1,3 +1,4 @@ +const now = DateTime.now(); const { DateTime } = require("luxon"); module.exports = function(eleventyConfig) { @@ -10,8 +11,8 @@ module.exports = function(eleventyConfig) { return DateTime.fromJSDate(value).toLocaleString(DateTime.DATETIME_FULL) }); - eleventyConfig.addFilter("copyrightyear", function(value) { - return DateTime.fromJSDate(value).toLocaleString({ year: 'numeric'}) + eleventyConfig.addFilter("copyrightyear", function() { + return DateTime.local().toFormat('y') }); return { diff --git a/index.njk b/index.njk index a11733c..663d898 100644 --- a/index.njk +++ b/index.njk @@ -105,6 +105,6 @@ date: Last Modified in the effort to make the web quick and usable again :)

This page was last updated at {{ page.date | timestamp }}
- Copyright Laura Kalb {{ date | copyrightyear }} + Copyright Laura Kalb {{ copyrightyear }}

Impressum und Datenschutzerklärung