mirror of
https://gitlab.com/davical-project/davical.git
synced 2026-03-13 08:00:15 +00:00
Handle events which don't have either DTEND *or* DURATION.
This commit is contained in:
parent
04f17a65af
commit
60fea594ae
@ -798,8 +798,18 @@ function expand_event_instances( $vResource, $range_start = null, $range_end = n
|
||||
$instance_start = $comp->GetProperty('DTSTART');
|
||||
$dtsrt = new RepeatRuleDateTime( $instance_start->Value(), $instance_start->GetParameterValue('TZID'));
|
||||
$instance_end = $comp->GetProperty($end_type);
|
||||
$dtend = new RepeatRuleDateTime( $instance_end->Value(), $instance_end->GetParameterValue('TZID'));
|
||||
$duration = $dtstart->RFC5545Duration( $dtend );
|
||||
if ( isset($instance_end) ) {
|
||||
$dtend = new RepeatRuleDateTime( $instance_end->Value(), $instance_end->GetParameterValue('TZID'));
|
||||
$duration = $dtstart->RFC5545Duration( $dtend );
|
||||
}
|
||||
else {
|
||||
if ( $instance_start->GetParameterValue('VALUE') == 'DATE' ) {
|
||||
$duration = 'P1D';
|
||||
}
|
||||
else {
|
||||
$duration = 'P0D'; // For clarity
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
$duration = $duration->Value();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user