945 - Fixed the javascript so it's not breaking every page this element is not on

This commit is contained in:
Jonathan Bobel
2023-11-27 16:19:54 -05:00
parent 74ace43668
commit c611fe38c9

View File

@@ -1,9 +1,10 @@
(function (window) {
"use strict";
// Show the current year
document.getElementById("current-year").innerHTML = new Date().getFullYear();
const currentYearElement = document.getElementById("current-year");
})(window);
if (currentYearElement) {
currentYearElement.textContent = new Date().getFullYear();
}
})(window);