-
Notifications
You must be signed in to change notification settings - Fork 9
/
README
38 lines (20 loc) · 2.13 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#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’s hours</a></noscript>
More questions? Feel free to contact Matthew Reidsma on Twitter at @mreidsma or via email at reidsmam@gvsu.edu.
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/>.