I have a Java & SQL web application where a business will enter their business open and closed time for each day of the week (Mon - Sun).
However, I need to display the business hours to the end user. Example: Mon - Wed open 8am to 5pm. Thurs open 8am to 6pm Fri open 8am to 8pm Sat & Sun closed
So, my brain has gone dead on trying to figure the best algorithm to dynamicly display business hours including consecutive days.
Can you guys give me suggestions on how to determine business hours using Java or SQL?
quote ------------------------------------------------------------------ However, I need to display the business hours to the end user. Example: Mon - Wed open 8am to 5pm. Thurs open 8am to 6pm Fri open 8am to 8pm Sat & Sun closed -------------------------------------------------------------------
What exactly you are tring to find out??? would you need to display some data based on business hours or someting different?
Thanks for the suggestion...but still does not answer it. As I loop through the list of days in the week, I need to do the following:
1) keep track of the days that have the same open and close time 2) determine if the days that have the same business hours are consecutive (eg. Mon - Fri, or Fri - Sat) 3) the challenge I'm facing is when there are more than 1 consecutive day sets that have the same business hours (eg: Mon-Thurs 8am - 5pm and Fri-Sun 11am - 11pm)
this seems trivial...but I don't understand why I'm having a hard time to come up with a dynamic algorithm for this....