set copyright date to current year

This commit is contained in:
Ray Elliott 2020-03-31 15:21:59 +00:00
parent 4684ccd512
commit d410e1141b
2 changed files with 10 additions and 1 deletions

View File

@ -35,6 +35,6 @@
<li class="footer__term"><a class="footer__link" href="{{ "terms-and-conditions" | relURL }}">Terms and Conditions</a></li>
<li class="footer__term"><a class="footer__link" href="{{ "privacy-policy" | relURL }}">Privacy Policy</a></li>
</ul>
<p class="footer__attr">Copyright &copy; <span id="js-copy-date">2020</span> &dash; <a class="footer__link" rel="nofollow" href="https://rayelliott.dev">rayelliott.dev</a></p>
<p class="footer__attr">Copyright &copy; <span id="js-copy-date">2019</span> &dash; <a class="footer__link" rel="nofollow" href="https://rayelliott.dev">rayelliott.dev</a></p>
</div>
</footer>

View File

@ -49,6 +49,14 @@ function initMapbox() {
.addTo(map);
}
function setCopyDate() {
const el = document.getElementById("js-copy-date");
if (el) {
const year = new Date().getFullYear();
el.innerHTML = year;
}
}
window.addEventListener("DOMContentLoaded", () => {
const swup = new Swup({
plugins: [new SwupPreloadPlugin(), new SwupScrollPlugin()]
@ -60,6 +68,7 @@ window.addEventListener("DOMContentLoaded", () => {
initMapbox();
});
setCopyDate();
initBlocks();
initMapbox();
});