app/Date/AbstractCalendarDate.php
public function getAgeFull(int $jd): string
    {
        if ($this->year === 0 || $jd === 0) {
            return '';
        }
        if ($this->minimum_julian_day < $jd && $this->maximum_julian_day > $jd) {
            return '';
        }
        if ($this->minimum_julian_day === $jd) {
            return '';
        }
        if ($jd < $this->minimum_julian_day) {
            return view('icons/warning');
        }
        [$y, $m, $d] = $this->calendar->jdToYmd($jd);
        $dy = $y - $this->year;
        $dm = $m - max($this->month, 1);
        $dd = $d - max($this->day, 1);
        if ($dd < 0) {
            $dm--;
        }
        if ($dm < 0) {
            $dm += $this->calendar->monthsInYear();
            $dy--;
        }
        // Age in years?
        if ($dy > 1) {
            return $dy . 'y';
        }
        $dm += $dy * $this->calendar->monthsInYear();
        // Age in months?
        if ($dm > 1) {
            return $dm . 'm';
        }

        // Age in days?
        return ($jd - $this->minimum_julian_day) . 'd';
    }
public function getAgeFull(int $jd): string
    {
        if ($this->year === 0 || $jd === 0) {
            return '';
        }
        if ($this->minimum_julian_day < $jd && $this->maximum_julian_day > $jd) {
            return '';
        }
        if ($this->minimum_julian_day === $jd) {
            return '';
        }
        if ($jd < $this->minimum_julian_day) {
            return view('icons/warning');
        }
        [$y, $m, $d] = $this->calendar->jdToYmd($jd);
        $dy = $y - $this->year;
        $dm = $m - max($this->month, 1);
        $dd = $d - max($this->day, 1);
        if ($dd < 0) {
            $dm--;
        }
        if ($dm < 0) {
            $dm += $this->calendar->monthsInYear();
            $dy--;
        }
        // Age in years?
        if ($dy > 1) {
            return $dy . 'y';
        }
        $dm += $dy * $this->calendar->monthsInYear();
        // Age in months?
        if ($dm > 1) {
            return $dm . 'm';
        }

        // Age in days?
        return ($jd - $this->minimum_julian_day) . 'd';
    }
public function getAgeFull ( int $ jd ) : string { if ( $ this -> year === 0 || $ jd === 0 ) { return '' ; } if ( $ this -> minimum_julian_day < $ jd && $ this -> maximum_julian_day > $ jd ) { return '' ; } if ( $ this -> minimum_julian_day === $ jd ) { return '' ; } if ( $ jd < $ this -> minimum_julian_day ) { return view ( 'icons/warning' ) ; } [ $ y , $ m , $ d ] = $ this -> calendar -> jdToYmd ( $ jd ) ; $ dy = $ y - $ this -> year ; $ dm = $ m - max ( $ this -> month , 1 ) ; $ dd = $ d - max ( $ this -> day , 1 ) ; if ( $ dd < 0 ) { $ dm -- ; } if ( $ dm < 0 ) { $ dm += $ this -> calendar -> monthsInYear ( ) ; $ dy -- ; } // Age in years? if ( $ dy > 1 ) { return $ dy . 'y' ; } $ dm += $ dy * $ this -> calendar -> monthsInYear ( ) ; // Age in months? if ( $ dm > 1 ) { return $ dm . 'm' ; } // Age in days? return ( $ jd - $ this -> minimum_julian_day ) . 'd' ; }
How long between an event and a given julian day
Return result as a gedcom-style age string.

@param int $jd date for calculation

@return string
How long between an event and a given julian day Return result as a gedcom - style age string .