Hello,
I am hoping someone with javascript programming experience can help me modify the below script. I think it is easy for someone who knows what they are doing. I work for a library and the below script works like a charm to show which days we are open. But....it would be great if it was slightly modified so that it included a check for holidays and then displayed "Holiday Closed" or words to that effect. I do not know javascript, but I think it is a simple if, then, else...we have multiple holidays so if somebody could just add the code for it to show "Holiday Closed" on christmas and one other date, i can modify from there for all of our dates. Thanks for whoever can give me a hand!
<script language="javascript">
var mydate=new Date();
var year=mydate.getYear();
var day=mydate.getDay();
var month=mydate.getMonth();
var daym=mydate.getDate();
var dayarray=new Array("sunday", "monday","tuesday","wednesday","thursday","friday","saturday");
var montharray=new Array("january","february","march","april","may","june","july","august","september","october","november","december");
var hourarray=new Array("<font color='#C60000'>Closed Today</font>", "open today from <font color='#C60000'>12pm to 8pm</font>", "open today from <font color='#C60000'>10am to 8pm</font>", "open today from <font color='#C60000'>10am to 6pm</font>", "open today from <font color='#C60000'>10am to 8pm</font>", "open today from <font color='#C60000'>10am to 4pm</font>", "open today from <font color='#C60000'>10am to 4pm</font>");
document.write("<font face='Arial' size=-2> " +hourarray[day]+"<br> <font color='#000000'>"+dayarray[day]+", "+montharray[month]+" "+daym+", "+year+"<br><font color='000000' face='Arial'>");
</script>
I am hoping someone with javascript programming experience can help me modify the below script. I think it is easy for someone who knows what they are doing. I work for a library and the below script works like a charm to show which days we are open. But....it would be great if it was slightly modified so that it included a check for holidays and then displayed "Holiday Closed" or words to that effect. I do not know javascript, but I think it is a simple if, then, else...we have multiple holidays so if somebody could just add the code for it to show "Holiday Closed" on christmas and one other date, i can modify from there for all of our dates. Thanks for whoever can give me a hand!
<script language="javascript">
var mydate=new Date();
var year=mydate.getYear();
var day=mydate.getDay();
var month=mydate.getMonth();
var daym=mydate.getDate();
var dayarray=new Array("sunday", "monday","tuesday","wednesday","thursday","friday","saturday");
var montharray=new Array("january","february","march","april","may","june","july","august","september","october","november","december");
var hourarray=new Array("<font color='#C60000'>Closed Today</font>", "open today from <font color='#C60000'>12pm to 8pm</font>", "open today from <font color='#C60000'>10am to 8pm</font>", "open today from <font color='#C60000'>10am to 6pm</font>", "open today from <font color='#C60000'>10am to 8pm</font>", "open today from <font color='#C60000'>10am to 4pm</font>", "open today from <font color='#C60000'>10am to 4pm</font>");
document.write("<font face='Arial' size=-2> " +hourarray[day]+"<br> <font color='#000000'>"+dayarray[day]+", "+montharray[month]+" "+daym+", "+year+"<br><font color='000000' face='Arial'>");
</script>