PDA

View Full Version : An old and simple question, not answered yet


elson
11-19-2002, 07:33 PM
:thumbsup: Hello good people,

I'm trying to create a calendar in a monthly view, and I need just the event portion of the code to generate a fixed sequencial work scale for five teams: A, B, C, D, E. Two teams a day, in a continuous twelve hours of working each: the first one from 08:00am to 08:00pm, and the other one from 08:00pm to 08:00am

Ex.:
day 22, document.write: A/E
day 23, document.write: B/A
day 24, document.write: C/B
day 25, document.write: D/C
day 26, document.write: E/D
day 27, document.write: A/E

And so on. The calendar indicates the month, the day, the day of the week, the year, and the option to go to the next or previous month.
I need just the event portion of the code that repeat the sequence indefinitely, not the whole calendar code. Ok?
Is it possible?

Roy Sinclair
11-19-2002, 09:51 PM
Get the milliseconds from the date and divide it by 86400000 to get the number of days since the base date for the timer. Now divide the number of days by 5 using the MOD function to get the remainder. You can use that remainder as your index into a string of A though E to get the first shift and add 1 (reset to 0 if > 4) to the value to get the index to the second shift.

elson
11-20-2002, 09:04 PM
:confused: Thanks Roy, for your kindly attention. But can you write some code? I'm beginner in this language.