From bddebb9ca55e0b235a04cfe98788966cfceb2cea Mon Sep 17 00:00:00 2001 From: StaffCollab Date: Wed, 1 May 2024 15:47:22 -0400 Subject: [PATCH] Quick fix --- src/HebrewDate.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/HebrewDate.php b/src/HebrewDate.php index 06d747b..75b3453 100644 --- a/src/HebrewDate.php +++ b/src/HebrewDate.php @@ -164,6 +164,15 @@ public static function createFromJewishDate($year, $month, $day): self throw new InvalidDateException("{$year} is not a leap year."); } - return HebrewDate::parse(jdtogregorian(jewishtojd($month, $day, $year))); + return self::parse(jdtogregorian(jewishtojd($month, $day, $year))); + } + + public function getCalendarInfo($lang = 'gregorian'): array + { + return [ + 'days' => $lang == 'hebrew' ? $this->getHebrewDaysPeriod() : $this->getDaysPeriod(), + 'months' => $lang == 'hebrew' ? $this->getHebrewMonthsPeriod() : $this->getMonthsPeriod(), + 'years' => $lang == 'hebrew' ? $this->getHebrewYearsPeriod() : $this->getYearsPeriod() + ]; } }