Hello.
I am trying to get a website to display a specific thing based on the hour of the day. I *think* this works (I'm a C person myself) but when I drop it into the CMS I'm using it displays nothing.
Thoughts?
Code:
<script Language="JavaScript">
var today = new Date();
var hours = today.getHours();
var readings = 0;
switch (hours)
{
case 0:
readings = 7;
break
case 1:
readings = 7;
break
case 2:
readings = 7;
break
case 3:
readings = 7;
break
case 4:
readings = 7;
break
case 5:
readings = 7;
break
case 6:
readings = 1;
break
case 7:
readings = 1;
break
case 8:
readings = 1;
break
case 9:
readings = 2;
break
case 10:
readings = 2;
break
case 11:
readings = 2;
break
case 12:
readings = 3;
break
case 13:
readings = 3;
break
case 14:
readings = 3;
break
case 15:
readings = 4;
break
case 16:
readings = 4;
break
case 17:
readings = 4;
break
case 18:
readings = 5;
break
case 19:
readings = 5;
break
case 20:
readings = 5;
break
case 21:
readings = 6;
break
case 22:
readings = 6;
break
case 23:
readings = 6;
break
}
AgpeyaHours = new Array(8);
AgpeyaHours[1]="Prime"
AgpeyaHours[2]="Terce"
AgpeyaHours[3]="Sext"
AgpeyaHours[4]="None"
AgpeyaHours[5]="Vespers"
AgpeyaHours[6]="Compline"
AgpeyaHours[7]="Midnight"
document.write(AgpeyaHours[readings]);
</script>