This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
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?
Thanks in advance....
Mohan Vinukonda
Ranch Hand
Joined: Jul 28, 2005
Posts: 32
posted
0
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?
-Mohan
Stan James
(instanceof Sidekick)
Ranch Hand
Joined: Jan 29, 2003
Posts: 8791
posted
0
I think the challenge is the the Mon-Wed part, no? I used to do a lot of group-break loops like this:
Does that make sense? Can anybody do it in SQL?
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Nina Anderson
Ranch Hand
Joined: Jul 18, 2006
Posts: 148
posted
0
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....