This is long delayed, but after much testing and many heartaches, we decided on a certain scheme to make this work. For the needs of our system, we are required only to recur on a weekly basis if at all. The final product will be designed as such.
Here is the DB schema
id : int(10)
window_name : varchar(100)
start_date : datetime
end_date : datetime
start_time : time
duration : int(10)
timezone: varchar(100)
monday : tinyint(1)
tuesday : tinyint(1)
...
sunday : tinyint(1)
- Each "window" of time will have a set start date, end date, start time and a duration.
- The window will open on the start date and start time and run for "duration" seconds
- The window will only open on specified days of the week
This is the only system that would allow windows to open and close on a recurring weekly basis and also have windows that would span into the next morning. I am sure there are more complex systems out there that do recurring windows, but we were looking for something flexible and fast, and did not need monthly recurring events or yearly events.