I am trying to dynamically load different CSS files based on the current date (season).
I attempted to tweak an image script that I found on Stack Overflow, but it didn't yield the desired result.
Could someone please guide me on where I might be making a mistake?
<link href="/css_season/default.css" rel="stylesheet" type="text/css" onload="logo(this)">
function logo(link) {
var d = new Date();
var today = d.getDate();
var month = d.getMonth();
var src;
if (month === 4 && (today >= 1 && today <= 30)) {
src = "/css_season/easter.css";
} else if (month === 7 && (today >= 1 && today <= 31)) {
src = "/css_season/vacation.css";
} else if ((month === 8 && today >= 30) || (month === 0 && today <= 2)) {
src = "/css_season/vacation.css";
} else if (month === 12 && (today >= 15 && today <= 31)) {
src = "/css_season/holidays.css";
}
link.href=src;
}