HTML Code - Go to footers-template-1 & copy the code starting from <footer>.
CSS Code - Copy the entire file. Remove the #footers-template-1 prefix from all selectors.
JS Code - Copy the following code & paste it in the footer.js file of the project that you are building.
const clientYear = document.querySelector('.clientYear').textContent;
const currentYearContainer = document.querySelector('.currentYear');
const torontoTime = new Date().toLocaleString("en-US", {timeZone: "America/Toronto"});
const currentYear = new Date(torontoTime).getFullYear();
if (clientYear != currentYear){
currentYearContainer.textContent = `-${currentYear}`;
}
HTML Code - Go to footers-template-2 & copy the code starting from <footer>.
CSS Code - Copy the entire file. Remove the #footers-template-2 prefix from all selectors.
JS Code - Copy the following code & paste it in the footer.js file of the project that you are building.
const clientYear = document.querySelector('.clientYear').textContent;
const currentYearContainer = document.querySelector('.currentYear');
const torontoTime = new Date().toLocaleString("en-US", {timeZone: "America/Toronto"});
const currentYear = new Date(torontoTime).getFullYear();
if (clientYear != currentYear){
currentYearContainer.textContent = `-${currentYear}`;
}