I've been able to show/hide a button if the time is within the range, however, how could I modify this to also check if the date is every second Tuesday, starting on December 1st?
<p id="newButton">LIVE</p>
window.addEventListener("load", function(){
var newButton = document.getElementById("newButton");
const start = 12 * 60 + 30;
const end = 13 * 60 + 30;
const date = new Date();
const now = date.getHours() * 60 + date.getMinutes();
if(start <= now && now <= end) {
newButton.style.display = "block";
alert("in time");
}
else {
newButton.style.display = "none";
alert("offline");
}
}, false);