Multiple repeating dates

sun - January 24, 2008 - 20:06
Project:Date
Version:7.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:active
Description

I'm currently doing a research for a new project that has the requirement to allow a user to submit a weekly/monthly schedule/timetable for "something" (availability, spare time, courses/lessons, or likewise repeating dates/"events"), and provide other users with a list of matching users, f.e. to build working groups, find the best date for an event, aso. For example, local user groups on g.d.o could benefit from this: Everyone interested in an event could supply a list of available dates/date ranges.

Simplified example: User A is available on every Monday 2-4 pm, and every Wednesday 4-6 pm. User B is available every Tuesday 8-9 pm, and every Wednesday 5-7 pm. Best match would be every Wednesday 5-6 pm.

I've tested the Availability module, but its features are very limited.
There's also the Resource conflict module, but it's fulfilling another purpose.
I've studied and tested event + eventrepeat modules, but those would require major customizations to realize something like that.

Finally I gave the new Date and Date Repeat modules in HEAD a try, and those look like they would basically suit best.
However, Date Repeat allows to assign either "unlimited" (multiple) or "repeating" only. It does not allow to input both, multiple repeating dates in one field.
In front of digging through all the code, I would like to know if it is planned to support multiple repeating dates in Date/Date API, and if it would be possible to implement from your POV.

If you think it should be possible and you would accept a patch, I would consider coding it, and developing a "Date Match" module that would provide the rest of the functionality: A node/views/block listing containing all nodes sharing the same or similar schedule, and/or a function to find a date that matches most schedules in certain nodes (f.e. filtered by taxonomy).

Since we need to talk to the client in the next few days, I'd be happy to have your opinion on this. Also, if you are open for developing this, please let me know privately, so we are able to take this into account.

#1

KarenS - January 24, 2008 - 23:03

I'm not completely sure multiple repeating dates in one field will work, but it might. I tried to keep the API very flexible.

Getting the current interface to work right in FAPI was very challenging -- a field that stores a RRULE strings gets dynamically expanded into a complex selection form and then the user selections are reconstructed into a new RRULE to be stored in the date field and used to compute the dates that match the rule to store them as the multiple values of that date in the database.

I thought getting that much working was pretty challenging, I think I stretched FAPI just about as far as it can go :)

Expanding on that to have multiple RRULEs, each with its own complex selection form and multiple resulting collections of dates that match the rule, hmm... I can see the use case for something like this, and I would say it is at least theoretically possible to do, but it might not be a simple thing to get all the FAPI stuff working together correctly.

The biggest advantage of Date over event + eventrepeat are that eventrepeat constructs a huge table of all the possible date values, and clears out past dates and adds future dates using cron. Then it searches that table for matches, which means you cannot create or edit repeats that started in the past, and you have a lot of overhead. Plus each match is made into a new node, which would not be desirable in this case. The date module can do computations for any date period and creates multiple fields in the original node and could also do the date computations on the fly instead of storing the results.

So I think this module is most likely the right place to start for something like this.

#2

sun - January 25, 2008 - 08:58

Hi Karen, thanks for your quick and detailed response! We recently needed to develop a custom CCK field with multiple values, and used the AHAH methods of Imagefield as a template for that. If you're not opposed to this, we would probably implement multiple repeating dates in a similar way.

#3

KarenS - January 25, 2008 - 10:59

I would love to get AHAH incorporated into the D5 version. It will automatically happen in D6 because of the changes in CCK for D6. So I'd gladly accept a patch for that in the 5.2 Date module, for sure.

#4

cpelham - February 19, 2008 - 06:01
Title:Multiple repeating dates/Date matching module?» Should Event Repeat be deprecated in favor of Date/Date Repeat?

Sean recently posted that he is thinking of retiring Event Repeat because it is his impression that Date/Date Repeat/Calendar will provide a better solution:

http://drupal.org/node/177108

From what I've read in this thread, that sounds accurate. I have not had a chance to install and play with dev versions of Date and Event to see if this is already the case or becoming the case. Do you agree? Or do you think Event Repeat provides or could/should provide some additional functionality beyond what Date/Date Repeat is setting out to do?

#5

KarenS - February 19, 2008 - 11:36
Status:active» fixed

I think Date Repeat will do the same or similar things as have been done by Event Repeat. It's actually an API that Event Repeat could use, but it would require the Date API. The Date module implements the API as a repeating date option.

The question about whether to deprecate Event Repeat is probably more about whether or not people still need the Event module, and lots are still using it. So long as the Event module exists there will probably be a need for Event Repeat.

So if the question is whether you can expect to be able to do the same or similar things with Date/Date Repeat, the answer is yes. The difference between Event and Date/Calendar is that the Event module creates only events and nothing else and does it with no requirement for using CCK or Views, while Date/Calendar builds on CCK and Views. The targeted module is easier to set up, since it has only that one purpose. The Date/Calendar combination is more flexible, but also more complicated to set up since it can do lots of different things.

#6

KarenS - February 19, 2008 - 12:04
Title:Should Event Repeat be deprecated in favor of Date/Date Repeat?» Multiple repeating dates
Category:support request» feature request
Status:fixed» active

Oops, this issue was actually about a different subject which is still active. Sun is proposing to make a way for multiple repeating date fields, and that is still an open feature request.

#7

sun - February 19, 2008 - 14:24

Unfortunately, the mentioned project that caused this issue has been canceled. However, I would still like to see this feature in Date module and I hope that I'll be able to come up with a patch if time permits. I'll assign this issue to me in front of working on it.

#8

hecatomber - February 6, 2009 - 11:35

Is there any hope about this feature?

I'm using a calendar like a Class Schedule. so if I have a lecture which happens on different days of the week, but also different times, I have to create 2 nodes for both of them. So I'll have two nodes of the same lecture, and this is not practical.

#9

ntripcevich - March 3, 2009 - 19:22

Hi--
I'm hoping for a similar feature.
I have equipment reservations to track and it seems like a more flexible structure for Date (recurring bookings/reservations at irregular time intervals) would meet the need perfectly. I can try to combine it with the Resource Conflict module for an adequate solution, or perhaps the Conflict warning ability (via Node Reference) of Resource Conflict would be designed into Date Repeat because it's common problem having overlapping Date ranges for a single Content item. Thanks!

#10

wretched sinner... - September 18, 2009 - 12:56

Another +1 subscribe (I hate those too. My coding skills aren't terribly flash, but I'm happy to test an implementation, if that is something that you are still willing to look at Karen.

Soli Deo gloria

#11

pauldawg - September 18, 2009 - 14:22

I agree this would be a great feature. A sample use case for this is a class that runs every week on Tuesdays from 7 PM to 11 PM and on Thursdays from 7 PM to 8 PM. There are lots of other real-world scenarios here. Currently the only workaround is to create multiple CCK Date fields but there are limitations to this, including that multiple fields do not integrate into a single "Schedule" tab or "Repeat" rule display.

As to the comment about the difficulty in using the FAPI for this, I cannot speak to that directly, but I do have some additional thoughts on the UI which I will be documenting shortly about potential improvements to the UI, so in light of this future enhancement request perhaps there may be a reason to bundle this into a larger enhancement... I will post a link to the enhancement request in a bit; stay tuned...

#12

ntripcevich - November 4, 2009 - 06:30

This module may be of interest to people reading this thread

MERCI (Manage Equipment Reservations, Checkout and Inventory)
http://drupal.org/project/merci

#13

davpas - December 2, 2009 - 23:43

MERCI does not yet handle repeating/recurring dates.

 
 

Drupal is a registered trademark of Dries Buytaert.