You are here

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

Add months to the instance. Positive $value travels forward while negative $value travels into the past.

Parameters

int $value:

Return value

static

3 calls to Carbon::addMonths()
Carbon::addMonth in src/Library/Carbon/Carbon.php
Add a month to the instance
Carbon::addQuarters in src/Library/Carbon/Carbon.php
Add quarters to the instance. Positive $value travels forward while negative $value travels into the past.
Carbon::subMonths in src/Library/Carbon/Carbon.php
Remove months from the instance

File

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

Class

Carbon
A simple API extension for DateTime

Namespace

Drupal\persian_date\Library\Carbon

Code

public function addMonths($value) {
  if (static::shouldOverflowMonths()) {
    return $this
      ->addMonthsWithOverflow($value);
  }
  return $this
    ->addMonthsNoOverflow($value);
}