Class EventDate
The value of an Event Date field: when an event starts and ends, and how it repeats.
An event that repeats has a Recurr rule built from the repeat attributes (freq, interval, byDay, etc.),
which generates its occurrences, along with any inclusion dates (inDates) and minus any exclusion dates (exDates).
Dates are in the event's timezone, or the system timezone for all day events.
The rule, occurrences, first start, last end, etc. are cached when they're first read,
and modifying the attributes afterwards doesn't update them. Only modify a value before
reading any of them (like DefaultController::actionDelete() does), or create a new one.
Extends Model
Constants
FREQ_DAILY
FREQ_WEEKLY
FREQ_MONTHLY
FREQ_YEARLY
ENDS_COUNT
ENDS_UNTIL
DEFAULT_DURATION
Default event duration in minutes, when no end is given (matches the input JS)
Properties
allowNeverEnding
public bool $allowNeverEnding
start
end
timezone
allDay
repeat
interval
freq
byDay
byMonthDay
ends
count
until
inDates
exDates
Methods
__construct
public __construct(mixed $config = []): mixed
|
|
|
$config |
mixed |
|
| return |
mixed |
|
repeatsForCount
public repeatsForCount(): bool
repeatsUntil
public repeatsUntil(): bool
repeatsWeekly
public repeatsWeekly(): bool
repeatsMonthly
public repeatsMonthly(): bool
getRule
rules
validateUntil
public validateUntil(): void
validateEndDate
public validateEndDate(): void
getRepeatDescription
public getRepeatDescription(): ?string
getOccurrences
Returns the occurrences, up to 732 of them (ArrayTransformer::DEFAULT_LIMIT).
Use getOccurrencesInRange() to get later occurrences.
public getOccurrences(?ConstraintInterface $constraint = null): \Recurr\RecurrenceCollection<array-key,Occurrence>
getNextOccurrence
public getNextOccurrence(bool $includeInProgress = false): ?Occurrence
getOccurrencesInRange
Returns the occurrences that start in the range (inclusive), or with $includeInProgress,
also those that started before the range and end after its start.
public getOccurrencesInRange(DateTimeInterface $start, DateTimeInterface $end, bool $includeInProgress = false): \Recurr\RecurrenceCollection<array-key,Occurrence>
|
|
|
$start |
DateTimeInterface |
|
$end |
DateTimeInterface |
|
$includeInProgress |
bool |
|
| return |
\Recurr\RecurrenceCollection<array-key,Occurrence> |
|
getFirstStartDate
public getFirstStartDate(): ?DateTime
getLastEndDate
public getLastEndDate(): ?DateTime
isPast