This question is more conceptual in nature then specific in terms of code.
I have a simple JavaScript that displays whether my company is open and our open hours on any given day of the week.
jQuery(document).ready(function($) {
var d = new Date();
var curDay = d.getDay();
$('#curDay').html(curDay);
if (curDay==1 || curDay==4) {
$('#hours-operation').html("We are open today<br>from 11am - 6pm");
} else if (curDay==3 || curDay==5) {
$('#hours-operation').html("We are open today<br>from 11am - 9pm");
} else if (curDay==0 || curDay==6) {
$('#hours-operation').html("We are open today<br>from 10am - 6pm");
} else {
$('#hours-operation').html("We are closed today<br><br>");
}
});
Lately we have had closings due to inclement weather on a semi regular basis. Is there a way to have an external entity change the script, for instance a form input? And have it remove itself when the clock moves to the next day, thereby resetting the script to it's original state? The best scenario would be not to edit the script itself at all.