Skip to content

A simple tool for displaying today's hours for your business or library written in Javascript.

License

Notifications You must be signed in to change notification settings

mreidsma/Today-s-Hours

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

#README - Today's Hours Script

---

This tool was developed by Matthew Reidsma in Javascript to provide an easy way .

INSTALLATION

Open the todayshours.js file in a text editor, and add your regular schedule by editing lines 21 and 26. Enter the time your library opens, starting with Sunday. If your library is closed, enter "X" for the time. In the following example, the library is closed on Sunday and opens at 9am Monday through Friday. On Saturday, the library opens at 1:30pm. The script will print whatever format you decide to use in these variables. Make sure to leave the quotes! Do the same with your closing times.

EXAMPLE:

var open=["X","9:00am","9:00am","9:00am","9:00am","9:00am","1:30pm"]; // Edit this line
var close=["X","10:00pm","10:00pm","10:00pm","10:00pm","10:00pm","9:00pm"]; // Edit this line

Now upload the todayshours.js file to your server. Whenever you want to display the hours the library is open today, simply call the Javascript file like this:

<script type="text/javascript" src="/PATH/TO/todayshours.js"></script>

You may want to offer an option for users who do not have javascript. In that case, include:

<script type="text/javascript" src="/PATH/TO/todayshours.js"></script><noscript><a href="/PATH/TO/HOURS/PAGE">Today&#8217;s hours</a></noscript>

More questions? Feel free to contact Matthew Reidsma on Twitter at @mreidsma or via email at [email protected].

DEMO

Open the included index.html page to see the todayshours.js script in action.

COPYRIGHT

This tool is copyright 2011 Grand Valley State University Libraries. 

This tool is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This tool is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this tool. If not, see <http://www.gnu.org/licenses/>.

About

A simple tool for displaying today's hours for your business or library written in Javascript.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published