Click to See Complete Forum and Search --> : Show daily shift schedule
ltat42
12-04-2002, 05:58 AM
I'm looking for a script that will show what shift is on duty each day. I work a shift that repeats itself everyday - A shift, B shift, C Shift. Each shift works 24hrs. ABC, ABC, ABC, ABC - etc...etc...etc...
Can you help??
ltat42
12-04-2002, 08:34 PM
Originally posted by Dave Clark
Set the last hour of each shift:
A = 7; // midnight to 8 o'clock
B = 15; // 8 to 4 o'clock
C = 23; // 4 to midnight
Get the current hour:
H = (new Date()).getHours();
Output the shift:
if (H > C || <= A) alert("A");
if (H > A && <= B) alert("B");
if (H > B && <= C) alert("C");
The above tests are dependent upon how the shifts are split over the course of the 24-hour day -- but can remain as they are as long as shift C does not work past midnight (in this case).
Dave
Thanx for the reply, however, as I mentioned in my original post, each shift is 24hrs, which relates to 7am-7am. At 7am on 12/4/02, A shift would report for duty, at 7am on 12/5, B shift would report for duty, at 7am on 12/6, C shift would report for duty, then it repeats itself - A,B,C,A,B,C,A,B,C...etc...etc...etc...
Thanx in advance...Jim
ltat42
12-05-2002, 04:42 AM
A Shift works Dec 1 2002 (7am-7am)
B Shift = Dec 2
C Shift = Dec 3
A = Dec 4
B = Dec 5
C = Dec 6
etc
etc
This script will be used on our FD's website, when visitors enter the site, the script would show what shift is on duty for that day.
An example of our shift schedule can been seen by going to:
www.iaff2969.com/2448.html
I don't know anything about how to write the script we're looking for, could you possibly help by sending an example and how to enter it into our webpage?
Credit will be forwarded!
Thanx...Jim
ltat42
12-05-2002, 06:38 AM
Can you post your website?