mirror of
https://gitlab.com/davical-project/davical.git
synced 2026-02-14 03:34:38 +00:00
Ensure we get a duration, and default to 1 day if not.
This commit is contained in:
parent
76768719c9
commit
b673ec32e6
@ -56,13 +56,15 @@ function get_freebusy( $path_match, $range_start, $range_end, $bin_privs = null
|
||||
foreach( $expansion AS $k => $v ) {
|
||||
// echo "=====================================================\n";
|
||||
// printf( "Type: %s\n", $v->GetType());
|
||||
// print_r($v);
|
||||
// echo "-----------------------------------------------------\n";
|
||||
$dtstart = $v->GetProperty('DTSTART');
|
||||
// print_r($dtstart);
|
||||
$start_date = new RepeatRuleDateTime($dtstart->Value());
|
||||
$start_date = $v->GetProperty('DTSTART');
|
||||
if ( !isset($start_date) ) continue;
|
||||
$start_date = new RepeatRuleDateTime($start_date->Value());
|
||||
$duration = $v->GetProperty('DURATION');
|
||||
$duration = ( !isset($duration) ? 'P1D' : $duration->Value());
|
||||
$end_date = clone($start_date);
|
||||
$end_date->modify( $duration->Value() );
|
||||
$end_date->modify( $duration );
|
||||
if ( $end_date < $range_start || $start_date > $range_end ) continue;
|
||||
$thisfb = $start_date->UTC() .'/'. $end_date->UTC() . $extra;
|
||||
array_push( $fbtimes, $thisfb );
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user