Cake\Chronos\Traits\ModifierTrait::nthOfQuarter PHP Method

nthOfQuarter() public method

Use the supplied consts to indicate the desired dayOfWeek, ex. ChronosInterface::MONDAY.
public nthOfQuarter ( integer $nth, integer $dayOfWeek ) : mixed
$nth integer The offset to use.
$dayOfWeek integer The day of the week to move to.
return mixed
    public function nthOfQuarter($nth, $dayOfWeek)
    {
        $dt = $this->copy()->day(1)->month($this->quarter * ChronosInterface::MONTHS_PER_QUARTER);
        $lastMonth = $dt->month;
        $year = $dt->year;
        $dt = $dt->firstOfQuarter()->modify("+{$nth}" . static::$days[$dayOfWeek]);
        return $lastMonth < $dt->month || $year !== $dt->year ? false : $dt;
    }