diff options
Diffstat (limited to 'library')
| -rw-r--r-- | library/WT/Date.php | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/library/WT/Date.php b/library/WT/Date.php index 15358748a7..0cd85de910 100644 --- a/library/WT/Date.php +++ b/library/WT/Date.php @@ -299,11 +299,13 @@ class WT_Date { // Calculate the number of full years between two events. // Return the result as either a number of years (for indi lists, etc.) static function GetAgeYears($d1, $d2=null, $warn_on_negative=true) { - if (!is_object($d1)) return; - if (!is_object($d2)) + if (!is_object($d1)) { + return ''; + } elseif (!is_object($d2)) { return $d1->date1->GetAge(false, WT_CLIENT_JD, $warn_on_negative ); - else + } else { return $d1->date1->GetAge(false, $d2->MinJD(), $warn_on_negative); + } } // Calculate the years/months/days between two events |
