Skip to content
A simple tool for displaying today's hours for your business or library written in Javascript.
Find file
Latest commit c45a66a @mreidsma Deleted useless files
Failed to load latest commit information.
LICENSE First commit.
README First commit.
index.html First commit.
todayshours.js Updated index.html demo and fixed comments in source


#README - Today's Hours Script


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


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.


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


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


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 <>.
Something went wrong with that request. Please try again.