Print

Print


Hi Mary,

This is probably not the best solution, but it is easy.  The javascript
below gives you a week of hours and displays only the current day, so you
only have to update it when the weekly hours change.  This is what we use
on our site (http://www.bc.edu/schools/law/library.html).

<p>
Today's Library Hours:<br>

<!cript type="text/javascript">
var Sunday='10AM - 11:45PM';
var Monday = '7:30AM - 11:45PM';
var Tuesday = '7:30AM - 11:45PM';
var Wednesday = '7:30AM - 11:45PM';
var Thursday = '7:30AM - 11:45PM';
var Friday = '7:30AM - 10PM';
var Saturday = '9AM - 10PM';

 function Hours (n) {
   this.length = n;
   for (var i =1; i <= n; i++) {
     this[i] = ' '
   }
 }
hours = new Array(7);
hours[0] = Sunday
hours[1] = Monday
hours[2] = Tuesday
hours[3] = Wednesday
hours[4] = Thursday
hours[5] = Friday
hours[6] = Saturday
var currentdate = new Date();
var daynumber = currentdate.getDay();
document.write(hours[daynumber]);
</script>
<br>
<a
href="/content/dam/files/schools/law_sites/library/pdf/Hours.pdf">Detailed
Listing of Hours</a></p>

I hope that helps, even if its just a short-term solution.

Best,
Nick


Nick Szydlowski
Digital Initiatives and Scholarly Communication Librarian
Boston College Law School
617 552-4474

On Tue, Nov 18, 2014 at 9:18 AM, Mary E. Hanlin <[log in to unmask]>
wrote:

> Hi All,
>
> I know this has been covered a bit here, but I have a rather exigent
> conundrum, and I'm hoping to figure out the best/easiest solution.
> Yesterday, the script to hour library hours (on our front page) which pulls
> from Google calendar stopped working ("Error at line undefined in
> undefined[!]" - the exclamation point is mine; it seemed like it needed
> one.)
>
> Basically, the code came from a site that walked one through how to call
> daily hours (javascript) using Google's V2 API, but the V2 is fully
> deprecated (as I abruptly discovered), and I need to figure out another
> solution.  (I haven't been able to find similar documentation for V3's API.)
>
> Some constraints: 1. Our IT will not support php.    We are an .NET shop
> with IIS servers.  2. We may not have the dough to pay for something like
> LibCal which seems to me the easiest solution.  3.  I'm semi-new to this
> "Internets/webmaster" thing, and really only know front-end coding, so a
> solution involving something like .NET, Python, etc. would have to have,
> "How to make a peanut butter sandwich," kind of documentation.
>
> Right now, I've just manually coded our hours, which is fine until
> Saturday when our hours change, and I'm not here (hopefully).  I will be
> super grateful for insight or knowledge.
>
> Mary.
>
> Mary Hanlin
> Electronic Resources and Web Librarian
> J. Sargeant Reynolds Community College
> Phone:804.523.5323
> Email: [log in to unmask]
>