Welcome Guest, Not a member yet? Register   Sign In
Creating events with recurring dates and times
#1

[eluser]Koodoo Creative[/eluser]
Hi everyone,

Working on a complex project at the moment and part of the project requires some Calendar based entries. There are several scenarios;

1. An event which has no start end dates (this is fine and catered for)
2. An event with a fixed start and end date (also fine as dealing with to and from)

The problem now is with;

3. An event which could reoccur on a Monday, weekly between 10:00am and 3:00pm but also on Tuesday it could reoccur monthly between 09:00am and 3:00pm.

Taking this into account, there would be:

* Frequency (Daily, Weekly, Monthly, Yearly)
* Date Time Start & Date Time End

Naturally each row or day

This is the initial parts of the thought process, does anyone know a good way or a already proven way to handle recurring events where the recurrence could vary depending on each day selected?

Thanks,

#2

[eluser]PhilTem[/eluser]
http://forums.codewalkers.com/php-coding...63316.html

http://forums.devshed.com/php-developmen...08696.html

I preferably would go with the solution posted in post #6 of the second link. But that's just because I love to use a lot of database relations Wink
#3

[eluser]Koodoo Creative[/eluser]

Thanks for that PhilTem,

Ideally we are looking at a solution which will not bog down the calendar tables with multiple entries, the ideal would be to compute each line as needed and display in the CI Calendar.

The other side of this is adding selected dates to users calendars, however that is another matter :-)

Will check those urls out and shout back if that's OK? :-)
#4

[eluser]PhilTem[/eluser]
If you don't want to bloat up your database, you should extend your table for the events with one column which holds some information about the recurrence of each event (like mentioned in the second post following the first link). However, for this case you would have to either have a rather complex query (since you can have recurring events from e.g. August 2009 which should be displayed in the month view for August 2012 as well) or you would have to get all rows from the database and post-process them properly in your model/library/controller.

If you have any problems with it, I might like to help if I got some spare time, since I wanted to do something like this for almost one year now but never really had the enthusiasm to really do it Wink
#5

[eluser]Koodoo Creative[/eluser]
[quote author="PhilTem" date="1342621246"]If you don't want to bloat up your database, you should extend your table for the events with one column which holds some information about the recurrence of each event (like mentioned in the second post following the first link). However, for this case you would have to either have a rather complex query (since you can have recurring events from e.g. August 2009 which should be displayed in the month view for August 2012 as well) or you would have to get all rows from the database and post-process them properly in your model/library/controller.

If you have any problems with it, I might like to help if I got some spare time, since I wanted to do something like this for almost one year now but never really had the enthusiasm to really do it Wink[/quote]

Thanks for the offer, this is something we've got to get developed quite quickly as it is part of a wider function of the web app we are developing for a client.

I'm going to have a read over those links, the first is one I stumbled on whilst searching so its good to know I wasn't too far off the mark with it.

My concern is the computations and processing for this task, performance is key to this function.

Any other suggestions or solutions also greatly appreciated.

Thanks,
#6

[eluser]PhilTem[/eluser]
Well, as long as you don't save recurring events separately for each event you will always have to run some tasks when getting the data. Whether it is with your MySQL-Query (you can do the selects with proper MySQL-Queries as well - I guess - but this is of course just "outsourced" tasks since you don't run them in PHP but on your database) or with your PHP post-processing of the collected data.

However, if you add the events with all it's recurring events one by one to the database, you would have the biggest amount of tasks to perform on event creation, but I think, compared to the version above, you will have less tasks to run on receiving and presenting the data.

Nonetheless, I don't think you will significantly notice the differences, as long as you're not running on a 10 year old server machine Wink Or while there aren't 10k requests per hour to that specific page (don't forget you can cache the page while there are no changed events Wink )
#7

[eluser]Koodoo Creative[/eluser]
[quote author="PhilTem" date="1342702461"]Well, as long as you don't save recurring events separately for each event you will always have to run some tasks when getting the data. Whether it is with your MySQL-Query (you can do the selects with proper MySQL-Queries as well - I guess - but this is of course just "outsourced" tasks since you don't run them in PHP but on your database) or with your PHP post-processing of the collected data.

However, if you add the events with all it's recurring events one by one to the database, you would have the biggest amount of tasks to perform on event creation, but I think, compared to the version above, you will have less tasks to run on receiving and presenting the data.

Nonetheless, I don't think you will significantly notice the differences, as long as you're not running on a 10 year old server machine Wink Or while there aren't 10k requests per hour to that specific page (don't forget you can cache the page while there are no changed events Wink )[/quote]

Thanks,

Dont suppose you have any suggestions for Schema and SQL queries to run? Been sitting on this all day and still trying to find a good solution which will work.




Theme © iAndrew 2016 - Forum software by © MyBB