Add addHalf()/subHalf() functions
This commit is contained in:
parent
a4650f8710
commit
af1ea1b5fd
@ -27,6 +27,26 @@ class Carbon extends CarbonBase
|
||||
}
|
||||
}
|
||||
|
||||
public function addHalf(): self
|
||||
{
|
||||
return $this->addHalves(1);
|
||||
}
|
||||
|
||||
public function addHalves(int $unit): self
|
||||
{
|
||||
return $this->addQuarters(2*$unit);
|
||||
}
|
||||
|
||||
public function subHalf(): self
|
||||
{
|
||||
return $this->subHalves(1);
|
||||
}
|
||||
|
||||
public function subHalves(int $unit): self
|
||||
{
|
||||
return $this->subQuarters(2*$unit);
|
||||
}
|
||||
|
||||
/**
|
||||
* Modify to the first occurrence of a given day of the week
|
||||
* in the current quarter. If no dayOfWeek is provided, modify to the
|
||||
|
Loading…
Reference in New Issue
Block a user