FW: [Web4lib] ASP or JavaScript code for library hours

Shawn E. Romine seromine at co.douglas.or.us
Wed Aug 20 13:32:02 EDT 2008


I sent this directly to Bill, but others might find it useful as
well....

-----Original Message-----
From: Shawn E. Romine 
Sent: Wednesday, August 20, 2008 7:51 AM
To: 'Bill Drew'
Subject: RE: [Web4lib] ASP or JavaScript code for library hours

Sent to you as a text file to increase the chances of it going through
our spam blockers, you will need to rename it .js and then call it from
within your webpage (if you need help with this part, glad to help).....

What you will need to do is modify the holidayarray with the dates of
your holidays....

The hourarray is a little messy, but you will see 8 times to include a
holiday closed....

the script starts with Sunday and therefore shows this....
"<font color='#C60000'>Closed Today</font>"

Monday is the next one and looks like this....just change the 1pm and
7pm text to fit your needs, ex: 8am and 8pm
"Open today from <font color='#C60000'>1pm&nbsp;to&nbsp;7pm</font>"

of course you can clean this up some, change the font color, etc....

let me know if I can be of anymore help....I too can only modify
existing code and couldn't write this from scratch......


-----Original Message-----
From: Bill Drew [mailto:dreww at tc3.edu] 
Sent: Wednesday, August 20, 2008 7:39 AM
To: Shawn E. Romine
Subject: RE: [Web4lib] ASP or JavaScript code for library hours

That is exactly what I am looking for.  Please send it my way.

Bill Drew

>>> "Shawn E. Romine" <seromine at co.douglas.or.us> 8/20/2008 10:33 AM
>>>
Be happy to share our code if it is what you are looking for, we
borrowed it from someone else and then modified it to our needs...

Here is an example for our Glendale branch....notice the Open Today
portion, that is the script that we call within our content management
system...you can also include your holidays and it will say Closed for
Holiday..
http://web1.co.douglas.or.us/tiki/tiki-index.php?page=glendale 


Let me know if this is what you are looking for and I will be glad to
share it.....


-----Original Message-----
From: web4lib-bounces at webjunction.org 
[mailto:web4lib-bounces at webjunction.org] On Behalf Of Bill Drew
Sent: Wednesday, August 20, 2008 6:52 AM
To: web4lib at webjunction.org 
Cc: lita-l at ala.org; lisug-discussion at ls.suny.edu 
Subject: [Web4lib] ASP or JavaScript code for library hours

I am looking for code for generating a table of library hours for
inclusion in our web pages.  I have some now but do not remember where
it came from.  I am looking for something a bit easier to maintain.  I
prefer it to be in ASP but am also interested in JavaScript.  I am
good
at modifying code to meet our local needs but do not have the
experience
or time to write from scratch.

Bill Drew


-----------------------------------------
Wilfred (Bill) Drew, M.S., B.S., A.S.
Assistant Professor
Librarian, Systems and Tech Services
Tompkins Cortland Community College  (TC3) Library:
http://www.tc3.edu/library/ 
Dryden, N.Y. 13053-0139
E-mail: dreww at tc3.edu 
Phone: 607-844-8222 ext.4406
AOL Instant Messenger:BillDrew4
Online Identity: http://claimID.com/billdrew 
StrengthsQuest: Ideation, Input, Learner, Activator, Communication
http://www.facebook.com/people/Bill_Drew/ 



_______________________________________________
Web4lib mailing list
Web4lib at webjunction.org 
http://lists.webjunction.org/web4lib/ 


-- 
This message has been scanned for viruses and dangerous content by
MailScanner, and is believed to be clean.

Douglas County, Oregon
www.co.douglas.or.us 


-- 
This message has been scanned for viruses and dangerous content by
MailScanner, and is believed to be clean.

Douglas County, Oregon
www.co.douglas.or.us

-------------- next part --------------
var mydate=new Date();
var year=mydate.getFullYear();
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 holidayarray=new Array("January 21","February 18","May 26","July 4","September 1","October 3","November 11","November 27","December 25","January 1");
var rx=new RegExp(montharray[month]+" "+daym+";","i");
var ex_day=(rx.test(holidayarray.join(";")+";"))?7:day;

var hourarray=new Array("<font color='#C60000'>Closed Today</font>", "Open today from <font color='#C60000'>1pm&nbsp;to&nbsp;7pm</font>", "Open today from <font color='#C60000'>10am&nbsp;to&nbsp;6pm</font>", "Open today from <font color='#C60000'>10am&nbsp;to&nbsp;6pm</font>", "Open today from <font color='#C60000'>10am&nbsp;to&nbsp;6pm</font>", "Open today from <font color='#C60000'>10am&nbsp;to&nbsp;5pm</font>", "Open today from <font color='#C60000'>11am&nbsp;to&nbsp;2pm</font>","<font color='#C60000'>Holiday - Closed Today</font>");
document.write("<font face='Arial' size=-1>&nbsp;&nbsp;&nbsp;<B>" +hourarray[ex_day]+"<br>&nbsp;&nbsp;&nbsp;<font color='#000000'>"+dayarray[day]+", "+montharray[month]+" "+daym+",  "+year+"<br></font>");


More information about the Web4lib mailing list