views:

253

answers:

3

I'm looking for a library in PHP (or better yet in ruby) to handle an events calendar. I've looked a dozens of them and every one breaks down when it comes to recurring events. Many require and end date and most create every recurring event as a entry in a database or something.

Every suggestion I get is to use the Google calendar which does do exactly what I want but I'm sure they won't let me build a service on top of there service.

+1  A: 

Sounds like you may not want to roll your own, but what about just setting up a cron job to check every x minutes if there are any events that have to be sent out?

John at CashCommons
+1  A: 

Haven't used Runt myself, but it looks like it might do what you want.

According to their homepage:

Runt is an implementation of select temporal patterns by Martin Fowler in the super-fantastic Ruby language. Runt provides:

  • ability to define recurring events using simple, set-like expressions
  • an interfaced-based API for creating schedules for arbitrary events/objects
  • precisioned date types using Time Points
  • date Ranges
  • everlasting peace and/or eternal life
+1  A: 

RiCal's recurrence rules would work for this. They do the math, the implementation would be up to you.

require 'rubygems'
require 'ri_cal'
rule = RiCal::PropertyValue::RecurrenceRule::RecurringMonthDay.new(15)
p rule.include?(Date.new(2025, 7, 15)) # true
Ben