Tags: collapse

diesel, learning, evil, sweeti


And the third big ticket item for Data::ICal::DateTime was some refactoring of the recurrence-id stuff. I moved the stuff for unifying RECURRENCE-ID stuff into a seperate function collapse() which means that in EventQueue I can have a function which gathers all the events from all the providers and then collapses them where necessary. This is useful because that means I can add notes to other people's calendars for example.

    # $span is a DateTime::Span
    # $period is something like 'hour', 'day', 'month' etc etc
    my @events;
    foreach my $provider ($self->providers) {
        push @events, $provider->events($span);
    @events = Data::ICal::DateTime::collapse(@events);
    @events = map { $_->split_up($period) } @events if $period;
    return @events;