views:

205

answers:

3

Hello,

i try to find a data structure for a calendar, which should offer the same functionality like googles calendar (want to build a structure in my own sql-database)..

It should offer one-time, multiple times, hole day, date-from til date-to, events and so on... But it's a bit hard to find out the right strucure - do you know where I can find a template or something else that helps me?

Thank you!

EDIT:

Hm... I didn't found any rails-plugins or something that fits my wishes...

I want to build a social networking site where users can create Appointments for doing freetime-activities... and therefor I need a calendar-structure...

Are there any rails plugins or something like that?

+1  A: 

Well, you can look at the Google Calendar GData API docs to get some ideas. I would strongly advise you not to be too ambitious though. Calendaring is really hard. Time zones, multiple attendees, recurrences (and exceptions to them), interop with other calendar systems etc are all painful.

The more you can limit yourself, the easier your life will be. For example, I suggest you try to make your recurrence representation fairly simple - with a minimum granularity of days rather than hours/seconds etc, and possibly prohibit concepts like "every Monday, Wednesday and Friday".

Can you give more background to why you want to create your own calendar system rather than using an existing one? Try to avoid doing it if at all possible :)

Jon Skeet
Much too much information - but thanks =)
Lichtamberg
+2  A: 

There is a standard that many of the calendar systems use for interchanging data between each other.

http://en.wikipedia.org/wiki/ICalendar

It's a little heavy and may be more than you're looking for. It might help though.

Brad Bruce
A: 

Check out a new gem called RiCal (http://rubyforge.org/projects/rical/). I haven't built anything with it yet, but it looks promising as a way of manipulating event information in Ruby.

Matt Gillooly