Results 1 to 2 of 2

Thread: Date vs Time

  1. #1
    mikerada6 is offline Member
    Join Date
    Oct 2010
    Posts
    10
    Rep Power
    0

    Default 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.

  2. #2
    venerik is offline Member
    Join Date
    Oct 2010
    Posts
    94
    Rep Power
    0

    Default

    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)

    Java Code:
    public class Employee {
        Availability[7] availability;
    
        Availability getAvailability(Date inDate){
            int dow = determineDayOfWeek(inDate);
            return avalailability[dow];
        }
    }
    This way the scheduler can check whether the employee is available during a shift or not.

    Cheers,
    Erik

Similar Threads

  1. converting string (GMT date) to date in US time.
    By JRuyechan in forum New To Java
    Replies: 1
    Last Post: 10-15-2010, 07:07 AM
  2. Time and Date
    By Manfizy in forum New To Java
    Replies: 0
    Last Post: 05-27-2009, 12:58 PM
  3. Time-Date problem
    By teo.danciu in forum New To Java
    Replies: 5
    Last Post: 08-27-2008, 10:01 AM
  4. Date/Time Servlet
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 01-14-2008, 09:34 AM
  5. how to get the current date and time
    By valery in forum New To Java
    Replies: 1
    Last Post: 08-03-2007, 06:05 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •