{% extends "global/hero.njk" %}
{% block heroImg %}
{% endblock %}
{% block eventScript %}
const todayEvent = getTodayEvent();
if (todayEvent) {
heroTopBarEl.classList.remove('hidden');
heroTopBarEl.innerHTML = todayEvent;
}
function getTodayEvent() {
const date = new Date();
const month = date.getMonth() + 1;
const day = date.getDate();
const currentYear = new Date().getFullYear();
const kotor1ReleaseDate = new Date("2003-07-15").getFullYear();
const kotor2ReleaseDate = new Date("2004-12-06").getFullYear();
const kotor1Anniversary = currentYear - kotor1ReleaseDate;
const kotor2Anniversary = currentYear - kotor2ReleaseDate;
if (month === 7 && day === 15)
return `
Today is the ${kotor1Anniversary}-year anniversary of the release of Star Wars: Knihgts of the Old Republic
`;
else if (month === 12 && day === 6)
return `
Today is the ${kotor2Anniversary}-year anniversary of the release of Star Wars: Knights of the Old Republic II — The Sith Lords
`;
else
return null;
}
{% endblock %}