diff --git a/inc/RRule.php b/inc/RRule.php index 2bde986e..cd8aeb1f 100644 --- a/inc/RRule.php +++ b/inc/RRule.php @@ -152,7 +152,9 @@ class Rfc5545Duration { if ( empty($this->as_text) ) { $this->as_text = ($this->epoch_seconds < 0 ? '-P' : 'P'); $in_duration = abs($this->epoch_seconds); - if ( $in_duration >= 86400 ) { + if ( $in_duration == 0 ) { + $this->as_text .= '0D'; + } elseif ( $in_duration >= 86400 ) { $this->days = floor($in_duration / 86400); $in_duration -= $this->days * 86400; if ( $in_duration == 0 && ($this->days / 7) == floor($this->days / 7) ) {