Results 1 to 2 of 2

Thread: Scheduled task program in java

  1. #1
    CoxWatson is offline Senior Member
    Join Date
    Dec 2009
    Posts
    232
    Rep Power
    3

    Default Scheduled task program in java

    I attempt to schedule a task to a resource, I get time and I want to check this to verify date if it is not planning a weekend. And if it is weekend I plan task mechanically next day and not weekends. But this is not functioning for me, so please provide me any suggestions about this.

  2. #2
    BrooksGray is offline Senior Member
    Join Date
    Dec 2009
    Posts
    231
    Rep Power
    3

    Default

    See the code given below which is useful for you:

    [CODE][/ private static boolean isJourTravaille(Calendar p_date)
    {
    Final List <Calendar> cal = new ArrayList <Calendar> ();
    Final Calendar calnd = (Calendar) p_date.clone();
    calnd.set(calnd.get(Calendar.YEAR), Calendar.JANUARY, 1);
    cal.add((Calendar) calnd.clone());
    calnd.set(calnd.get(Calendar.YEAR), Calendar.MAY, 1);
    cal.add((Calendar) calnd.clone());
    calnd.set(calnd.get(Calendar.YEAR), Calendar.MAY, 8);
    cal.add((Calendar) calnd.clone());
    calnd.set(calnd.get(Calendar.YEAR), Calendar.JULY, 14);
    cal.add((Calendar) calnd.clone());
    calnd.set(calnd.get(Calendar.YEAR), Calendar.AUGUST, 15);
    cal.add((Calendar) calnd.clone());
    calnd.set(calnd.get(Calendar.YEAR), Calendar.NOVEMBER, 1);
    cal.add((Calendar) calnd.clone());
    calnd.set(calnd.get(Calendar.YEAR), Calendar.NOVEMBER, 11);
    cal.add((Calendar) calnd.clone());
    calnd.set(calnd.get(Calendar.YEAR), Calendar.DECEMBER, 25);
    cal.add((Calendar) calnd.clone());
    }
    ]

Similar Threads

  1. operating system java program
    By Williamsjones in forum Programming
    Replies: 1
    Last Post: 02-08-2010, 12:50 PM
  2. Java program
    By MoralesWard in forum Programming
    Replies: 1
    Last Post: 02-02-2010, 05:16 PM
  3. the ternary operator in java program
    By WilsonMartin in forum Programming
    Replies: 1
    Last Post: 01-28-2010, 06:07 PM
  4. statement in java program
    By PetersonClark in forum Programming
    Replies: 1
    Last Post: 01-27-2010, 02:50 PM
  5. modern month name using java program
    By RodríguezBrown in forum Programming
    Replies: 1
    Last Post: 01-22-2010, 06:19 PM

Bookmarks

Posting Permissions

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

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 39 40 41 42 43 44 45 46 47 48