mirror of
https://github.com/rlanvin/php-rrule.git
synced 2025-02-26 15:54:14 +01:00
Humanreadable gets monthly wrong
This commit is contained in:
parent
38ea18eb55
commit
ccbc749f65
@ -2186,6 +2186,11 @@ class RRule implements RRuleInterface
|
|||||||
$parts['bymonth'] = strtr(self::i18nSelect($i18n['bymonth'], count($tmp)), array(
|
$parts['bymonth'] = strtr(self::i18nSelect($i18n['bymonth'], count($tmp)), array(
|
||||||
'%{months}' => self::i18nList($tmp, $i18n['and'])
|
'%{months}' => self::i18nList($tmp, $i18n['and'])
|
||||||
));
|
));
|
||||||
|
|
||||||
|
if ($freq_str == 'yearly') {
|
||||||
|
// if a yearly frequency is being displayed by month, then switch "of the year" text to be monthly
|
||||||
|
$freq_str = 'monthly';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (not_empty($this->rule['BYWEEKNO'])) {
|
if (not_empty($this->rule['BYWEEKNO'])) {
|
||||||
|
@ -3204,6 +3204,24 @@ class RRuleTest extends TestCase
|
|||||||
"daily",
|
"daily",
|
||||||
"daily"
|
"daily"
|
||||||
),
|
),
|
||||||
|
array(
|
||||||
|
"RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=+2TU",
|
||||||
|
array('locale' => "en", 'include_start' => false, 'explicit_infinite' => false),
|
||||||
|
"yearly on the second Tuesday of the month in March",
|
||||||
|
"yearly on the second Tuesday of the month in March"
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
"RRULE:FREQ=YEARLY;BYMONTH=3,6,9;BYDAY=+2TU",
|
||||||
|
array('locale' => "en", 'include_start' => false, 'explicit_infinite' => false),
|
||||||
|
"yearly on the second Tuesday of the month in March, June and September",
|
||||||
|
"yearly on the second Tuesday of the month in March, June and September"
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
"RRULE:FREQ=YEARLY;BYDAY=+6WE",
|
||||||
|
array('locale' => "en", 'include_start' => false, 'explicit_infinite' => false),
|
||||||
|
"yearly on the 6th Wednesday of the year",
|
||||||
|
"yearly on the 6th Wednesday of the year"
|
||||||
|
),
|
||||||
// with custom_path
|
// with custom_path
|
||||||
'custom_path' => array(
|
'custom_path' => array(
|
||||||
"DTSTART:20170202T000000Z\nRRULE:FREQ=YEARLY;UNTIL=20170205T000000Z",
|
"DTSTART:20170202T000000Z\nRRULE:FREQ=YEARLY;UNTIL=20170205T000000Z",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user