1
0
mirror of https://github.com/rlanvin/php-rrule.git synced 2025-02-21 10:54:14 +01:00

Option to omit until part in humanreadable (#36)

This commit is contained in:
ShoresOfNowhere 2017-10-11 12:29:00 +02:00 committed by Rémi Lanvin
parent d67a4bd27f
commit 8049f629f4

View File

@ -2329,7 +2329,8 @@ class RRule implements RRuleInterface
'date_formatter' => null,
'fallback' => 'en',
'explicit_infinite' => true,
'include_start' => true
'include_start' => true,
'include_until' => true
);
// attempt to detect default locale
@ -2581,6 +2582,7 @@ class RRule implements RRuleInterface
}
// to X, or N times, or indefinitely
if ( $opt['include_until'] ) {
if ( ! $this->until && ! $this->count ) {
if ( $opt['explicit_infinite'] ) {
$parts['end'] = $i18n['infinite'];
@ -2599,6 +2601,7 @@ class RRule implements RRuleInterface
)
);
}
}
$parts = array_filter($parts);
$str = implode('',$parts);