Calendar - Events to span multiple days

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
CRichardson
Forum Newbie
Posts: 12
Joined: Sat Jun 02, 2007 7:22 pm

Calendar - Events to span multiple days

Post by CRichardson »

I am in the process of developing a calendar application.

At the moment I am trying to find a method which allows events to span over multiple days.

It has already caused many hours of problems!

Storing and retrieving the information is not a problem.

For example, let's say an event starts on 01/04/2009 and ends on 05/04/2009. I would like to show that information literately and visually spanning over those days.

Has anybody developed anything like this before? Can anybody offer any advice at all? :D

Please see attached example for better understanding.
Attachments
example-2.jpg
example-2.jpg (80.55 KiB) Viewed 404 times
example-1.jpg
example-1.jpg (88.35 KiB) Viewed 403 times
Yossarian
Forum Contributor
Posts: 101
Joined: Fri Jun 30, 2006 4:43 am

Re: Calendar - Events to span multiple days

Post by Yossarian »

There are 2 schools of thought that I have come across.

a) as you have said, a start and end date.

your dbase is full of entries that start and end on the same day
entries seem to go on through midnight and the early hours and into the next day - is that what you want?
works nicely for "I am on holiday"
"whats on today" views can cause complex sql statements

b) each day is an entry, so a 5 day event has 5 entries.

does not work so nicely for "I am on holiday" unless you factor it in and simplify the ui
works nicely for "I have to attend training every morning next week"
works nicely for time slots
works nicely for recurring events (book every tuesday evening 'till September)
works nicely for single events, you are only storing start time / end time
"whats on today" sql is very simple

I think a lot depends upon the expected use of your calendar.
Post Reply