You are here

public function Carbon::nthOfYear in Persian Date for Drupal 8 8.4

Modify to the given occurrence of a given day of the week in the current year. If the calculated occurrence is outside the scope of the current year, then return false and no modifications are made. Use the supplied constants to indicate the desired dayOfWeek, ex. static::MONDAY.

Parameters

int $nth:

int $dayOfWeek:

Return value

mixed

File

src/Library/Carbon/Carbon.php, line 3287

Class

Carbon
A simple API extension for DateTime

Namespace

Drupal\persian_date\Library\Carbon

Code

public function nthOfYear($nth, $dayOfWeek) {
  $dt = $this
    ->copy()
    ->firstOfYear()
    ->modify('+' . $nth . ' ' . static::$days[$dayOfWeek]);
  return $this->year === $dt->year ? $this
    ->modify($dt) : false;
}