Skip Menu |

This queue is for tickets about the Date-Range CPAN distribution.

Report information
The Basics
Id: 60527
Status: open
Priority: 0/
Queue: Date-Range

People
Owner: Nobody in particular
Requestors: jhannah [...] omnihotels.com
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: (no value)
Fixed in: (no value)



Subject: Feature request: grow() or merge() ?
Hi Tony, Have you thought about adding a grow() or merge()? I have a jillion date ranges coming out of an XML file and I want to merge them into the simplest set of ranges possible to store in my database. Perhaps I'll write Date::RangeSet, something like: while (my $range = ...) { $rangeset->add($range); } $rangeset->merge; foreach my $range ($rangeset->all) { # store in database } So 100 input ranges could end up being merged into a single range (complete overlap), or 10 ranges (some overlap), or 100 ranges (no overlap). Unless you can think of a elegant way to accomplish this with Date::Range? :) Thanks, j
I added a Date::RangeSet class and tests, for your consideration: http://github.com/jhannah/date-range Thanks, j
Looks like I forked Date::Range 1.40 back in 2010 https://github.com/jhannah/date-range and added Date::RangeSet to it. But in 2011 Tony release Date::Range 1.41 without my changes. I haven't heard from him.