mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-22 16:03:47 +01:00
Don't use start or end for range labels if they're missing / 0
This commit is contained in:
parent
3ac3cfeb24
commit
d69661ab55
@ -121,8 +121,8 @@ class calendar_merge extends bo_merge
|
||||
$id = array('start' => PHP_INT_MAX, 'end' => 0);
|
||||
$this->ids = array();
|
||||
foreach($events as $event) {
|
||||
if($event['start'] < $id['start']) $id['start'] = $event['start'];
|
||||
if($event['end'] > $id['end']) $id['end'] = $event['end'];
|
||||
if($event['start'] && $event['start'] < $id['start']) $id['start'] = $event['start'];
|
||||
if($event['end'] && $event['end'] > $id['end']) $id['end'] = $event['end'];
|
||||
// Keep ids for future use
|
||||
$this->ids[] = $event['id'];
|
||||
}
|
||||
@ -225,8 +225,8 @@ class calendar_merge extends bo_merge
|
||||
if($date[0]['start']) {
|
||||
$id = array('start' => PHP_INT_MAX, 'end' => 0);
|
||||
foreach($date as $event) {
|
||||
if($event['start'] < $id['start']) $id['start'] = $event['start'];
|
||||
if($event['end'] > $id['end']) $id['end'] = $event['end'];
|
||||
if($event['start'] && $event['start'] < $id['start']) $id['start'] = $event['start'];
|
||||
if($event['end'] && $event['end'] > $id['end']) $id['end'] = $event['end'];
|
||||
}
|
||||
$date = $id;
|
||||
} else {
|
||||
@ -309,8 +309,8 @@ class calendar_merge extends bo_merge
|
||||
{
|
||||
$dates = array('start' => PHP_INT_MAX, 'end' => 0);
|
||||
foreach($id as $event) {
|
||||
if($event['start'] < $dates['start']) $dates['start'] = $event['start'];
|
||||
if($event['end'] > $dates['end']) $dates['end'] = $event['end'];
|
||||
if($event['start'] && $event['start'] < $dates['start']) $dates['start'] = $event['start'];
|
||||
if($event['end'] && $event['end'] > $dates['end']) $dates['end'] = $event['end'];
|
||||
}
|
||||
$id = $dates;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user