Results 1 to 2 of 2
Thread: Date vs Time
- 10-28-2010, 06:18 PM #1
Member
- Join Date
- Oct 2010
- Posts
- 10
- Rep Power
- 0
Date vs Time
I am trying to write a scheduling program for my work. The way I was thinking of doing this was creating a class for each employee, availability, and shift and. Each employee would have an object of availability for each day of the week. The availability would store just a time of when they could work. i.e. 10:00 Am - 8:30 PM. Then every week i would create all the different shifts i want to have i.e. 10/25/2010 3:00 PM - 11:00 PM. I am having trouble finding a good way to compare the employees availability to the shift since the shift contains a date where the availability does not. any ideas on a good was to do this? Thanks in advance.
- 10-29-2010, 12:34 AM #2
Member
- Join Date
- Oct 2010
- Posts
- 94
- Rep Power
- 0
In your problem statement you say an employee has an availability for each day of the week. Maybe you could ask the employee about his availability given a certain date.
For example (in pseudo code)
This way the scheduler can check whether the employee is available during a shift or not.Java Code:public class Employee { Availability[7] availability; Availability getAvailability(Date inDate){ int dow = determineDayOfWeek(inDate); return avalailability[dow]; } }
Cheers,
Erik
Similar Threads
-
converting string (GMT date) to date in US time.
By JRuyechan in forum New To JavaReplies: 1Last Post: 10-15-2010, 07:07 AM -
Time and Date
By Manfizy in forum New To JavaReplies: 0Last Post: 05-27-2009, 12:58 PM -
Time-Date problem
By teo.danciu in forum New To JavaReplies: 5Last Post: 08-27-2008, 10:01 AM -
Date/Time Servlet
By Java Tip in forum Java TipReplies: 0Last Post: 01-14-2008, 09:34 AM -
how to get the current date and time
By valery in forum New To JavaReplies: 1Last Post: 08-03-2007, 06:05 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks