This is a case where DateTime::Event::Spreadsheet might have been useful.
DateTime::Event::Spreadsheet never went to CPAN, but it can be
downloaded from sourceforge (links below).
DT::Spreadsheet is a special case of DateTime::SpanSet, which stores
all information in 'cells' - such as:
my @matched_cells = $dtes->intersects( $base_date );
There is a lot more functionality in this little module, please take a
look at the tests.
----
Main module:
http://perl-date-time.svn.sourceforge.net/viewvc/perl-date-time/modules/DateTime-Event-Spreadsheet/trunk/lib/DateTime/Event/Spreadsheet.pm
Tests:
http://perl-date-time.svn.sourceforge.net/viewvc/perl-date-time/modules/DateTime-Event-Spreadsheet/trunk/t/
All files:
http://perl-date-time.svn.sourceforge.net/viewvc/perl-date-time/modules/DateTime-Event-Spreadsheet/trunk/
2010/5/14 Rick Measham <[email protected]>:
> On 14/05/2010 9:03 AM, Sean Robinson wrote:
>>
>> Has anyone used DateTime and friends to find scheduling conflicts and been
>> able to identify the offending events without walking a list of Spans?
>>
>
> A few years back I was in the same place you are right now. Have a look
> through the archive for my work on the catholic liturgical calendar: It has
> many rules about conflicts. I was planning on using DateTime to work out
> when a particular hol[iy]day was in a given year. To do that I was going to
> put everything into spans and sets in priority order, then use conflicts to
> move particluar feasts. Finally I'd have a spanset for the whole year. Each
> span in that set would then be able to return which holy day it was. Once
> that was set up, I could pass in a date and check for a 'conflict' in order
> to determine on which holy day that date fell.
>