Property | Type | Description | |
---|---|---|---|
$frequencies | frequency names | ||
$week_days | weekdays numbered from 1 (ISO-8601 or date('N')) |
Property | Type | Description | |
---|---|---|---|
$LAST_DAY_OF_MONTH | array | ||
$LAST_DAY_OF_MONTH_366 | array | ||
$MONTHDAY_MASK | array | ||
$MONTHDAY_MASK_366 | array | ||
$MONTH_MASK | array | ||
$MONTH_MASK_366 | array | ||
$NEGATIVE_MONTHDAY_MASK | array | ||
$NEGATIVE_MONTHDAY_MASK_366 | array | ||
$REPEAT_CYCLES | array | Maximum number of cycles after which a calendar repeats itself. This is used to detect infinite loop: if no occurrence has been found after this numbers of cycles, we can abort. The Gregorian calendar cycle repeat completely every 400 years (146,097 days or 20,871 weeks). A smaller cycle would be 28 years (1,461 weeks), but it only works if there is no dropped leap year in between. 2100 will be a dropped leap year, but I'm going to assume it's not going to be a problem anytime soon, so at the moment I use the 28 years cycle. | |
$WEEKDAY_MASK | array | ||
$byhour | |||
$byminute | |||
$bymonth | |||
$bymonthday | |||
$bymonthday_negative | |||
$bysecond | |||
$bysetpos | |||
$byweekday | |||
$byweekday_nth | |||
$byweekno | |||
$byyearday | |||
$cache | |||
$count | |||
$current | |||
$dtstart | parsed and validated values | ||
$freq | |||
$i18n | Stores translations once loaded (so we don't have to reload them all the time) | ||
$interval | |||
$intl_loaded | |||
$key | |||
$rule | original rule | ||
$timeset | |||
$total | cache variables | ||
$until | |||
$wkst |
Method | Description | |
---|---|---|
__construct ( mixed $parts ) | The constructor needs the entire rule at once. | |
__toString ( ) : string | Magic string converter. | |
clearCache ( ) | Clear the cache. | |
count ( ) : integer | Returns the number of occurrences in this rule. It will have go through the whole recurrence, if this hasn't been done before, which introduces a performance penality. | |
current ( ) | ||
getOccurrences ( ) : array | Return all the occurrences in an array of \DateTime. | |
getOccurrencesBetween ( mixed $begin, mixed $end ) : array | Return all the ocurrences after a date, before a date, or between two dates. | |
getRule ( ) : array | Return the internal rule array, as it was passed to the constructor. | |
humanReadable ( array $opt = [] ) : string | Format a rule in a human readable string intl extension is required. | |
isFinite ( ) : boolean | Return true if the rrule has an end condition, false otherwise | |
isInfinite ( ) : boolean | Return true if the rrule has no end condition (infite) | |
key ( ) | ||
next ( ) | ||
occursAt ( mixed $date ) : boolean | Return true if $date is an occurrence. | |
offsetExists ( $offset ) | ||
offsetGet ( $offset ) | ||
offsetSet ( $offset, $value ) | ||
offsetUnset ( $offset ) | ||
parseDate ( mixed $date ) : DateTime | Convert any date into a DateTime object. | |
parseRfcString ( string $string ) : array | Take a RFC 5545 string and returns an array (to be given to the constructor) | |
rewind ( ) | ||
rfcString ( boolean $include_timezone = true ) : string | Format a rule according to RFC 5545 | |
valid ( ) |
Method | Description | |
---|---|---|
buildNthWeekdayMask ( integer $year, integer $month, integer $day, array &$masks ) : null | Calculate the yeardays corresponding to each Nth weekday (in BYDAY rule part). | |
buildWeeknoMask ( integer $year, integer $month, integer $day, array &$masks ) : null | Calculate the yeardays corresponding to the week number (in the WEEKNO rule part). | |
getDaySet ( integer $year, integer $month, integer $day, array $masks ) : array | Return an array of days of the year (numbered from 0 to 365) of the current timeframe (year, month, week, day) containing the current date | |
getTimeSet ( integer $hour, integer $minute, integer $second ) : array | Build an array of every time of the day that matches the BYXXX time criteria. | |
i18nList ( array $array, string $and = 'and' ) : string | Create a comma-separated list, with the last item added with an " and " Example: Monday, Tuesday and Friday | |
i18nLoad ( string $locale, string | null $fallback = null ) : array | Load a translation file in memory. | |
i18nSelect ( mixed $array, string $n ) : string | Select a translation in $array based on the value of $n | |
iterate ( $reset = false ) : DateTime | null | This is the main method, where all of the magic happens. |
public __construct ( mixed $parts ) | ||
$parts | mixed | An assoc array of parts, or a RFC string. |
public __toString ( ) : string | ||
return | string | a rfc string |
public clearCache ( ) |
public getOccurrences ( ) : array | ||
return | array | An array of \DateTime objects |
public humanReadable ( array $opt = [] ) : string | ||
$opt | array | |
return | string |
public isInfinite ( ) : boolean | ||
return | boolean |
public static parseRfcString ( string $string ) : array | ||
$string | string | The rule to be parsed |
return | array |
protected static array $LAST_DAY_OF_MONTH | ||
return | array |
protected static array $LAST_DAY_OF_MONTH_366 | ||
return | array |
protected static array $MONTHDAY_MASK_366 | ||
return | array |
protected static array $NEGATIVE_MONTHDAY_MASK | ||
return | array |
protected static array $NEGATIVE_MONTHDAY_MASK_366 | ||
return | array |
protected static array $REPEAT_CYCLES | ||
return | array |
protected static $i18n |
public static $week_days |