I'm running into a wall trying to figure out why and intersection of a Span
and a SpanSet isn't coming out the way I'm expecting and am being stymied
by the opacity of DateTimes in general.

In broad terms, I'm doing something like this:

$span = DateTime::Span->from_datetimes(
                start  => DateTime->from_epoch(epoch=>$this->start_time),
                before => DateTime->from_epoch(epoch=>$this->end_time)
        )->set_time_zone('America/New_York');

The SpanSet is a constructed by taking 
DateTime::SpanSet->empty_set->complement and intersecting with it things
like:

        DateTime::SpanSet->from_set_and_duration(
                set => DateTime::Event::Recurrence->daily( hours => $min),
                hours => $max-$min,
                minutes => 59,
                seconds => 59
        )->set_time_zone('America/New_York'); 

        ...and:

        
        DateTime::SpanSet->from_set_and_duration(
                set => DateTime::Set->from_recurrence(
                        recurrence => sub {
                                my ($dt) = @_;
                                return $dt->truncate(to => 'day')
                                        ->add(days => ($min-$dt->wday()+7-1) % 
7 + 1);
                        },
                ),
                days => $max-$min,
                hours => 23,
                minutes => 59,
                seconds => 59
        )->set_time_zone('America/New_York');

The spanset and span seem to be what I'm expecting, but the intersection
keeps coming out as undefined.  What tools exist to help dig into this?

Reply via email to