CronExpression_MonthField::increment()publicWC 1.0

{@inheritdoc}

Method of the class: CronExpression_MonthField{}

No Hooks.

Return

null. Nothing (null).

Usage

$CronExpression_MonthField = new CronExpression_MonthField();
$CronExpression_MonthField->increment( $date, $invert );
$date(DateTime) (required)
-
$invert **
-
Default: false

CronExpression_MonthField::increment() code WC 8.7.0

public function increment(DateTime $date, $invert = false)
{
    if ($invert) {
        // $date->modify('last day of previous month'); // remove for php 5.2 compat
        $date->modify('previous month');
        $date->modify($date->format('Y-m-t'));
        $date->setTime(23, 59);
    } else {
        //$date->modify('first day of next month'); // remove for php 5.2 compat
        $date->modify('next month');
        $date->modify($date->format('Y-m-01'));
        $date->setTime(0, 0);
    }

    return $this;
}