Skip Menu |

This queue is for tickets about the DateTime-Set CPAN distribution.

Report information
The Basics
Id: 50750
Status: resolved
Priority: 0/
Queue: DateTime-Set

Owner: FGLOCK [...]
Requestors: peter.spikings [...]

Bug Information
Severity: Important
Broken in: 0.28
Fixed in: (no value)

Subject: DateTime::SpanSet->duration return infinity if set empty
Download (untitled) / with headers
text/plain 456b
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.
fixed in 0.29 added new method is_empty_set()

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

Please report any issues with to