srl wrote:

> Hi. I've looked briefly at Set::Infinite::Date. It seems like it
> might be useful for Reefknot (http://www.reefknot.org).  One of the
> things we need to be able to do is to calculate, for example,
> recurring appointments.  RFC2445 specifies ways to talk about
> recurrences: "This event happens from 13:00 to 14:00 every Tuesday,
> unless that Tuesday is the 15th of the month." That's a complex
> case, but you get the idea.
> 
> Your module seems only to do union/intersection of times; do you
> think it could be extended to handle recurrence calculation as an
> infinite series? Or does it do that already, and I just haven't
> noticed in my brief read-through of the documentation?
> 

Shane:
I'm sorry for the long delay.

The module does something more or less like that in the
"Quantize_Date.pm" module. 
It works by generating a tied array of sets of dates.

I think it CAN be extended to do recurrence. 
I am not sure of the syntax yet, I am afraid it can get too complex to
be useful.
maybe you could help (maybe something SQL-like?).

This is an example of the syntax for "Quantize_Date". 
I use this to help drawing calendars:

1  use Set::Infinite::Quantize_Date;
2  Set::Infinite->type('Set::Infinite::Date');
3
4  my @month = Set::Infinite->new("2001-04-01
00:00:00")->quantize('months', 1);
5  my @day = $month[0]->quantize('days', 1) ;

line 2 says to Set::Infinite that we are globally working with dates. 
I don't like this line, but I can't do better.

line 4 gets the months that contain the date 2001-04-01. 
It is just one month, but "quantize" returns a tied array.

line 5 gets the day-intervals inside the month. 

- Flavio S. Glock

Reply via email to