Closed jeremyswright closed 4 years ago
I tend to make the collection manually:
$collection = new PeriodCollection();
$c = Period::make('2018-01-01', '2018-01-05');
$d = Period::make('2018-01-10', '2018-01-15');
$collection[] = $c;
$collection[] = $d;
Or, in its shortest form:
$collection = PeriodCollection::make(
Period::make('2018-01-01', '2018-01-05'),
Period::make('2018-01-10', '2018-01-15')
);
If you really want join
, I'd be open for a PR.
I've just picked this library up and it's proving really useful. Could you tell me if/how it's possible to join periods? As in if I add a period to a period/collection, it would create a flattened/normalized collection of the two.
If I add a period to a collection it just holds the period even it they overlap.
I suspect it's a technique that I haven't figured out. A pointer would be very welcome.
Many thanks,
Jerry