mirror of
https://gitlab.com/davical-project/davical.git
synced 2026-05-01 16:11:20 +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');
|
$instance_start = $comp->GetProperty('DTSTART');
|
||||||
$dtsrt = new RepeatRuleDateTime( $instance_start->Value(), $instance_start->GetParameterValue('TZID'));
|
$dtsrt = new RepeatRuleDateTime( $instance_start->Value(), $instance_start->GetParameterValue('TZID'));
|
||||||
$instance_end = $comp->GetProperty($end_type);
|
$instance_end = $comp->GetProperty($end_type);
|
||||||
$dtend = new RepeatRuleDateTime( $instance_end->Value(), $instance_end->GetParameterValue('TZID'));
|
if ( isset($instance_end) ) {
|
||||||
$duration = $dtstart->RFC5545Duration( $dtend );
|
$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 {
|
else {
|
||||||
$duration = $duration->Value();
|
$duration = $duration->Value();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user