Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
StaffCollab committed May 1, 2024
2 parents ca56dc6 + 187e426 commit 1ec9699
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/HebrewDate.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,37 +36,43 @@ public function subHebrewMonths(int $month = 1): self
public function addHebrewYears(int $year = 1): self
{
$this->jewishYear += $year;

return self::createFromJewishDate($this->jewishYear, $this->jewishMonth, $this->jewishDay);
}

public function subHebrewYears(int $year = 1): self
{
$this->jewishYear -= $year;

return self::createFromJewishDate($this->jewishYear, $this->jewishMonth, $this->jewishDay);
}

public function startOfHebrewMonth(): self
{
$this->jewishDay = 1;

return self::createFromJewishDate($this->jewishYear, $this->jewishMonth, $this->jewishDay);
}

public function endOfHebrewMonth(): self
{
$this->startOfHebrewMonth()->addHebrewMonths()->subDay();

return self::createFromJewishDate($this->jewishYear, $this->jewishMonth, $this->jewishDay);
}

public function startOfHebrewYear(): self
{
$this->jewishMonth = 1;
$this->jewishDay = 1;

return self::createFromJewishDate($this->jewishYear, $this->jewishMonth, $this->jewishDay);
}

public function endOfHebrewYear(): self
{
$this->startOfHebrewYear()->addHebrewYears()->subDay();

return self::createFromJewishDate($this->jewishYear, $this->jewishMonth, $this->jewishDay);
}

Expand Down

0 comments on commit 1ec9699

Please sign in to comment.