Closed VConsulting closed 1 year ago
I found the solution through the video https://www.youtube.com/watch?v=k97mwdmocZY
$collection = new PeriodCollection();
foreach ($this->array_events[$day] as $event) {
$collection = $collection->add(Period::make($event['event_start'], $event['event_ended'], Precision::MINUTE()));
}
$gaps = $collection->gaps();
Hello,
Probably stupid, but I can't. How to fill the PeriodCollection via an array of data:
It doesn't work, error: Undefined property: Spatie\Period\PeriodCollection::$Period
thank you