my-website/static/scripts/updatecopyrightyear.js

16 lines
419 B
JavaScript
Raw Normal View History

"use strict";
{
2023-03-10 15:08:43 +01:00
const copyrightYearElement = document.getElementById("footer-copyrightyear");
2023-03-10 15:08:43 +01:00
if (copyrightYearElement) {
const currentYearAsStr = new Date().getFullYear().toString();
2023-03-10 15:08:43 +01:00
copyrightYearElement.innerText = currentYearAsStr;
copyrightYearElement.dateTime = currentYearAsStr;
} else
console.error(
"Could not find the footer entry for the year of the copyright notice."
);
}