public function Carbon::isSameMonth in Persian Date for Drupal 8 8.4
Checks if the passed in date is in the same month as the instance month (and year if needed).
Parameters
\Drupal\persian_date\Library\Carbon\Carbon|null $dt The instance to compare with or null to use current day.:
bool $ofSameYear Check if it is the same month in the same year.:
Return value
bool
1 call to Carbon::isSameMonth()
- Carbon::isCurrentMonth in src/
Library/ Carbon/ Carbon.php - Determines if the instance is in the current month
File
- src/
Library/ Carbon/ Carbon.php, line 1868
Class
- Carbon
- A simple API extension for DateTime
Namespace
Drupal\persian_date\Library\CarbonCode
public function isSameMonth(Carbon $dt = null, $ofSameYear = false) {
$format = $ofSameYear ? 'Y-m' : 'm';
return $this
->isSameAs($format, $dt);
}