Results 1 to 2 of 2
  1. #1
    pratik4891 is offline Member
    Join Date
    Nov 2013
    Posts
    1
    Rep Power
    0

    Default Calculate next Business day excluding weekend and Holidays

    Hello ,

    This is my first post to the forum hoping to find a solution on this

    My requirement is to find the next business day say if today is Friday and next Monday is holiday the program will return the next Tuesday

    So far I am able to complete to check the weekends ,however unable to build the logic for holidays

    I was thinking of creating an array list of holiday dates and the compare it with the date after checking the weekends

    How should I create an arraylist of Calendar Days ? Could anyone please help me with the code ?

    Thanks for the help.

  2. #2
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    3,524
    Rep Power
    5

    Default Re: Calculate next Business day excluding weekend and Holidays

    One way would be to create a Set of holidays stored as a class or string. Then when you think you know the next work day, check and make certain that date is not a holiday.

    Regards,
    Jim
    The Java™ Tutorial | SSCCE | Java Naming Conventions
    Poor planning our your part does not constitute an emergency on my part.

Similar Threads

  1. Date Math with weekends & holidays?
    By ShaneO in forum New To Java
    Replies: 3
    Last Post: 07-10-2013, 09:05 AM
  2. Creating an array of children while excluding grandchildren.
    By xcallmejudasx in forum Advanced Java
    Replies: 3
    Last Post: 10-28-2008, 09:40 PM
  3. Public Holidays (Australia)
    By oranjeBoven in forum Advanced Java
    Replies: 0
    Last Post: 02-13-2008, 08:14 AM

Posting Permissions

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