diff --git a/app/assets/javascripts/date.js b/app/assets/javascripts/date.js index 1d6a0d353..59a67c501 100644 --- a/app/assets/javascripts/date.js +++ b/app/assets/javascripts/date.js @@ -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); \ No newline at end of file