You are here

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

Get the difference in weekend days using a filter

Parameters

\Drupal\persian_date\Library\Carbon\Carbon|null $dt:

bool $abs Get the absolute of the difference:

Return value

int

File

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

Class

Carbon
A simple API extension for DateTime

Namespace

Drupal\persian_date\Library\Carbon

Code

public function diffInWeekendDays(Carbon $dt = null, $abs = true) {
  return $this
    ->diffInDaysFiltered(function (Carbon $date) {
    return $date
      ->isWeekend();
  }, $dt, $abs);
}