views:

21

answers:

1

Hi, I've built a website for a local yoga studio (PHP). The site has a calendar. The instructor keeps needing to cancel a random class here and there. The problem is that we either have to cancel all the instances of a weekly repeating date to remove it from the calendar, or cancel none of them and hope that people read the announcements on the front page.

I'm trying to puzzle out how to have a mechanism where I can let her just cancel one instance of a weekly repeating date, but am neither able to comprehend the solution, nor to find anything on here that someone else has tried.

I have plenty of open source calendar scripts to hack up, and just need this one little feature. Any ideas?

Many thanks.

A: 

This is a not an entirely straightforward problem. You either need to:

  • To list all repeated dates in the database
  • To have a list of 'cancelled' dates in the database

How are the recurring dates currently implemented?

James Hall
It's a rather large chunk that has an RECUR column that has values for "weekly" or "monthly", and a REPEATS column that tells the number of repeats, 0 meaning indefinitely. Various queries are made looking for weekly, yearly, or monthly recurring events, the number of times they repeat, and that set is added to the $events variable which is printed out at the end.
JGrubb
I'm wondering if maybe a "cancel_upcoming" column that could remove the first X values from the returned dataset? It'd have to be babysat, but it might work.
JGrubb