mirror of
https://gitlab.com/davical-project/davical.git
synced 2026-04-27 15:31:32 +00:00
fix: Rfc5545Duration __toString returns "P" when in_duration==0
This commit is contained in:
parent
04f2da406e
commit
467a6bf890
@ -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) ) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user