method makeRecurrencesFields documentation in bbn\Appui\Event
Makes the fields structure on the given event recurrences
function(array $event, array $recurrences)
{
$ef =& $this->class_cfg['arch']['events'];
// Calculate the diff between the event start and the event end
$diff = !empty($event[$ef['end']]) ? date_diff(new DateTime($event[$ef['start']]), new DateTime($event[$ef['end']])) : false;
// Fix fields
return array_map(function($d) use($event, $ef, $diff){
$d = \is_string($d) ? $d : $d->format('Y-m-d H:i:s');
$e = null;
if ( $diff ){
$e = new DateTime($d);
$e = $e->add($diff)->format('Y-m-d H:i:s');
}
return array_merge($event, [
$ef['start'] => $d,
$ef['end'] => $e,
'recurrence' => (int)($event[$ef['start']] !== $d)
]);
}, $recurrences);
}
Makes the fields structure on the given event recurrences BBN is a suite of PHP and JS libraries and VueJS components - all open-source! bbn.io, build applications, the quick way
This website uses cookies to ensure you get the best experience on our website.
© 2011-2023
BBN Solutions