my-website/static/scripts/updatecopyrightyear.js

16 lines
419 B
JavaScript

"use strict";
{
const copyrightYearElement = document.getElementById("footer-copyrightyear");
if (copyrightYearElement) {
const currentYearAsStr = new Date().getFullYear().toString();
copyrightYearElement.innerText = currentYearAsStr;
copyrightYearElement.dateTime = currentYearAsStr;
} else
console.error(
"Could not find the footer entry for the year of the copyright notice."
);
}