Subject: | DateTime::SpanSet->duration return infinity if set empty |
To quickly (without checking all the spans) see if a SpanSet spans any
times I do $spanset->span->duration->is_positive(). This returns true
even if the spanset is empty because a span without a start date or end
date returns an infinite duration.
I fixed this by adding the next line of code to the top of
DateTime::Span::duration but you're the expert so there may be a better
way :)
return DateTime::Duration->new if not $_[0]->{set};
Thanks,
Peter.