コード例 #1
0
ファイル: Shim.php プロジェクト: tunandras/webtrees
 /**
  * Converts a Julian day count to a Jewish calendar date.
  *
  * Shim implementation of JdtoJjewish()
  *
  * @link https://php.net/JdtoJewish
  *
  * @param integer $julian_day A Julian Day number
  * @param boolean $hebrew     If true, the date is returned in Hebrew text
  * @param integer $fl         If $hebrew is true, then add alafim and gereshayim to the text
  *
  * @return string|boolean A string of the form "month/day/year", or false on error
  */
 public static function jdToJewish($julian_day, $hebrew, $fl)
 {
     if ($hebrew) {
         if ($julian_day < 347998 || $julian_day > 4000075) {
             return trigger_error('Year out of range (0-9999).', E_USER_WARNING);
         }
         return self::$jewish_calendar->jdToHebrew($julian_day, (bool) ($fl & CAL_JEWISH_ADD_ALAFIM_GERESH), (bool) ($fl & CAL_JEWISH_ADD_ALAFIM), (bool) ($fl & CAL_JEWISH_ADD_GERESHAYIM));
     } else {
         // The upper limit is hard-coded into PHP to prevent numeric overflow on 32 bit systems.
         return self::jdToCalendar(self::$jewish_calendar, $julian_day, 347998, 324542846);
     }
 }