try year filter again

This commit is contained in:
Adora Laura Kalb 2023-06-04 20:27:58 +02:00
parent 5ea2dbf283
commit 1ef52d30f1
Signed by: adoralaura
GPG key ID: 7A4552166FC8C056
2 changed files with 4 additions and 3 deletions

View file

@ -1,3 +1,4 @@
const now = DateTime.now();
const { DateTime } = require("luxon"); const { DateTime } = require("luxon");
module.exports = function(eleventyConfig) { module.exports = function(eleventyConfig) {
@ -10,8 +11,8 @@ module.exports = function(eleventyConfig) {
return DateTime.fromJSDate(value).toLocaleString(DateTime.DATETIME_FULL) return DateTime.fromJSDate(value).toLocaleString(DateTime.DATETIME_FULL)
}); });
eleventyConfig.addFilter("copyrightyear", function(value) { eleventyConfig.addFilter("copyrightyear", function() {
return DateTime.fromJSDate(value).toLocaleString({ year: 'numeric'}) return DateTime.local().toFormat('y')
}); });
return { return {

View file

@ -105,6 +105,6 @@ date: Last Modified
in the effort to make the web quick and usable again :) in the effort to make the web quick and usable again :)
<br/><br/>This page was last updated at {{ page.date | timestamp }} <br/><br/>This page was last updated at {{ page.date | timestamp }}
<br/> <br/>
Copyright Laura Kalb {{ date | copyrightyear }} Copyright Laura Kalb {{ copyrightyear }}
<br/><br/><a href="/impressum.html">Impressum und Datenschutzerklärung</a> <br/><br/><a href="/impressum.html">Impressum und Datenschutzerklärung</a>
</p> </p>