Documentation

CronExpression_DayOfMonthField extends CronExpression_AbstractField
in package

Day of month field. Allows: * , / - ? L W

'L' stands for "last" and specifies the last day of the month.

The 'W' character is used to specify the weekday (Monday-Friday) nearest the given day. As an example, if you were to specify "15W" as the value for the day-of-month field, the meaning is: "the nearest weekday to the 15th of the month". So if the 15th is a Saturday, the trigger will fire on Friday the 14th. If the 15th is a Sunday, the trigger will fire on Monday the 16th. If the 15th is a Tuesday, then it will fire on Tuesday the 15th. However if you specify "1W" as the value for day-of-month, and the 1st is a Saturday, the trigger will fire on Monday the 3rd, as it will not 'jump' over the boundary of a month's days. The 'W' character can only be specified when the day-of-month is a single day, not a range or list of days.

Tags
author

Michael Dowling mtdowling@gmail.com

Table of Contents

increment()  : mixed
{@inheritdoc}
isIncrementsOfRanges()  : bool
Check if a value is an increments of ranges
isInIncrementsOfRanges()  : bool
Test if a value is within an increments of ranges (offset[-to]/step size)
isInRange()  : bool
Test if a value is within a range
isRange()  : bool
Check if a value is a range
isSatisfied()  : bool
Check to see if a field is satisfied by a value
isSatisfiedBy()  : mixed
{@inheritdoc}
validate()  : mixed
{@inheritdoc}
getNearestWeekday()  : DateTime
Get the nearest day of the week for a given day in a month

Methods

increment()

{@inheritdoc}

public increment(DateTime $date[, mixed $invert = false ]) : mixed
Parameters
$date : DateTime
$invert : mixed = false
Return values
mixed

isIncrementsOfRanges()

Check if a value is an increments of ranges

public isIncrementsOfRanges(string $value) : bool
Parameters
$value : string

Value to test

Return values
bool

isInIncrementsOfRanges()

Test if a value is within an increments of ranges (offset[-to]/step size)

public isInIncrementsOfRanges(string $dateValue, string $value) : bool
Parameters
$dateValue : string

Set date value

$value : string

Value to test

Return values
bool

isInRange()

Test if a value is within a range

public isInRange(string $dateValue, string $value) : bool
Parameters
$dateValue : string

Set date value

$value : string

Value to test

Return values
bool

isRange()

Check if a value is a range

public isRange(string $value) : bool
Parameters
$value : string

Value to test

Return values
bool

isSatisfied()

Check to see if a field is satisfied by a value

public isSatisfied(string $dateValue, string $value) : bool
Parameters
$dateValue : string

Date value to check

$value : string

Value to test

Return values
bool

isSatisfiedBy()

{@inheritdoc}

public isSatisfiedBy(DateTime $date, mixed $value) : mixed
Parameters
$date : DateTime
$value : mixed
Return values
mixed

getNearestWeekday()

Get the nearest day of the week for a given day in a month

private static getNearestWeekday(int $currentYear, int $currentMonth, int $targetDay) : DateTime
Parameters
$currentYear : int

Current year

$currentMonth : int

Current month

$targetDay : int

Target day of the month

Return values
DateTime

Returns the nearest date

Search results