Latimeradam
Feb 20, 2015, 03:17 PM
I have added a javascript calendar to my site how can I display the opening and closing times for all seven days rather than today's only.
</script>
<script type="text/javascript">
var todaydate=new Date();
var curmonth=todaydate.getMonth()+1; //get current month (1-12)
var curyear=todaydate.getFullYear(); //get current year
document.write(buildCal(curmonth ,curyear, "main", "month", "daysofweek", "days", 1));
</script>
<script type="text/javascript">
var curday=todaydate.getDay();
document.write("Today opening times <br/> <br/>");
if (curday==0){
document.write ("we are closed on Sunday");
}
if (curday==1){
document.write("09:00am-12:00pm</br> 12:00pm-01:00pm Break </br> 01:00pm-05:00pm</br>");
}
if (curday==2){
document.write("09:00am-12:00pm</br> 12:00pm-01:00pm Break </br> 01:00pm-05:00pm</br>");
}
if (curday==3){
document.write("09:00am-12:00pm</br> 12:00pm-01:00pm Break </br> 01:00pm-05:00pm</br>");
}
if (curday==4){
document.write("09:00am-12:00pm</br> 12:00pm-01:00pm Break </br> 01:00pm-05:00pm</br>");
}
if (curday==5){
document.write("09:00am-12:00pm</br> 12:00pm-01:00pm Break </br> 01:00pm-05:00pm</br>");
}
if (curday==6){
document.write("09:00am-12:00pm</br> 12:00pm-01:00pm Break </br> 01:00pm-05:00pm</br>");
}
</script>
here is the coding for the calendar, in the stylesheet I declare the body, the nav bar how would I declare for the calendar in order for it to be middle right in the page.
</script>
<script type="text/javascript">
var todaydate=new Date();
var curmonth=todaydate.getMonth()+1; //get current month (1-12)
var curyear=todaydate.getFullYear(); //get current year
document.write(buildCal(curmonth ,curyear, "main", "month", "daysofweek", "days", 1));
</script>
<script type="text/javascript">
var curday=todaydate.getDay();
document.write("Today opening times <br/> <br/>");
if (curday==0){
document.write ("we are closed on Sunday");
}
if (curday==1){
document.write("09:00am-12:00pm</br> 12:00pm-01:00pm Break </br> 01:00pm-05:00pm</br>");
}
if (curday==2){
document.write("09:00am-12:00pm</br> 12:00pm-01:00pm Break </br> 01:00pm-05:00pm</br>");
}
if (curday==3){
document.write("09:00am-12:00pm</br> 12:00pm-01:00pm Break </br> 01:00pm-05:00pm</br>");
}
if (curday==4){
document.write("09:00am-12:00pm</br> 12:00pm-01:00pm Break </br> 01:00pm-05:00pm</br>");
}
if (curday==5){
document.write("09:00am-12:00pm</br> 12:00pm-01:00pm Break </br> 01:00pm-05:00pm</br>");
}
if (curday==6){
document.write("09:00am-12:00pm</br> 12:00pm-01:00pm Break </br> 01:00pm-05:00pm</br>");
}
</script>
here is the coding for the calendar, in the stylesheet I declare the body, the nav bar how would I declare for the calendar in order for it to be middle right in the page.