StructuredCalendarSpec
in package
uses
CloneWith
FinalYes
StructuredCalendarSpec describes an event specification relative to the calendar, in a form that's easy to work with programmatically. Each field can be one or more ranges.
A timestamp matches if at least one range of each field matches the corresponding fields of the timestamp, except for year: if year is missing, that means all years match. For all fields besides year, at least one Range must be present to match anything.
Tags
Table of Contents
Properties
- $comment : string
- Free-form comment describing the intention of this spec.
- $daysOfMonth : array<string|int, mixed>
- Match days of the month (1-31)
- $daysOfWeek : array<string|int, mixed>
- Match days of the week (0-6; 0 is Sunday).
- $hours : array<string|int, mixed>
- Match hours (0-23)
- $minutes : array<string|int, mixed>
- Match minutes (0-59)
- $months : array<string|int, mixed>
- Match months (1-12)
- $seconds : array<string|int, mixed>
- Match seconds (0-59)
- $years : array<string|int, mixed>
- Match years.
Methods
- new() : self
- withAddedDayOfMonth() : self
- withAddedDayOfWeek() : self
- withAddedHour() : self
- withAddedMinute() : self
- withAddedMonth() : self
- withAddedSecond() : self
- withAddedYear() : self
- withComment() : self
- withDaysOfMonth() : self
- withDaysOfWeek() : self
- withHours() : self
- withMinutes() : self
- withMonths() : self
- withSeconds() : self
- withYears() : self
- __construct() : mixed
Properties
$comment read-only
Free-form comment describing the intention of this spec.
public
string
$comment
$daysOfMonth read-only
Match days of the month (1-31)
public
array<string|int, mixed>
$daysOfMonth
$daysOfWeek read-only
Match days of the week (0-6; 0 is Sunday).
public
array<string|int, mixed>
$daysOfWeek
$hours read-only
Match hours (0-23)
public
array<string|int, mixed>
$hours
$minutes read-only
Match minutes (0-59)
public
array<string|int, mixed>
$minutes
$months read-only
Match months (1-12)
public
array<string|int, mixed>
$months
$seconds read-only
Match seconds (0-59)
public
array<string|int, mixed>
$seconds
$years read-only
Match years.
public
array<string|int, mixed>
$years
Methods
new()
public
static new() : self
Return values
selfwithAddedDayOfMonth()
public
withAddedDayOfMonth(Range $dayOfMonth) : self
Parameters
- $dayOfMonth : Range
Return values
selfwithAddedDayOfWeek()
public
withAddedDayOfWeek(Range $dayOfWeek) : self
Parameters
- $dayOfWeek : Range
Return values
selfwithAddedHour()
public
withAddedHour(Range $hour) : self
Parameters
- $hour : Range
Return values
selfwithAddedMinute()
public
withAddedMinute(Range $minute) : self
Parameters
- $minute : Range
Return values
selfwithAddedMonth()
public
withAddedMonth(Range $month) : self
Parameters
- $month : Range
Return values
selfwithAddedSecond()
public
withAddedSecond(Range $second) : self
Parameters
- $second : Range
Return values
selfwithAddedYear()
public
withAddedYear(Range $year) : self
Parameters
- $year : Range
Return values
selfwithComment()
public
withComment(string $comment) : self
Parameters
- $comment : string
Return values
selfwithDaysOfMonth()
public
withDaysOfMonth(Range ...$daysOfMonth) : self
Parameters
- $daysOfMonth : Range
Return values
selfwithDaysOfWeek()
public
withDaysOfWeek(Range ...$daysOfWeek) : self
Parameters
- $daysOfWeek : Range
Return values
selfwithHours()
public
withHours(Range ...$hours) : self
Parameters
- $hours : Range
Return values
selfwithMinutes()
public
withMinutes(Range ...$minutes) : self
Parameters
- $minutes : Range
Return values
selfwithMonths()
public
withMonths(Range ...$months) : self
Parameters
- $months : Range
Return values
selfwithSeconds()
public
withSeconds(Range ...$seconds) : self
Parameters
- $seconds : Range
Return values
selfwithYears()
public
withYears(Range ...$years) : self
Parameters
- $years : Range
Return values
self__construct()
private
__construct() : mixed