diff options
| author | fisharebest <fisharebest@gmail.com> | 2013-07-13 07:00:12 +0000 |
|---|---|---|
| committer | fisharebest <fisharebest@gmail.com> | 2013-07-13 07:00:12 +0000 |
| commit | 403fe0b97c58135162150b4704c80371411ac195 (patch) | |
| tree | e402f54ea6083fa924740c569068c9e3ab36923c | |
| parent | 3d5a9b6f3466027684aba3e57e2aefa139e4df41 (diff) | |
| download | webtrees-403fe0b97c58135162150b4704c80371411ac195.tar.gz webtrees-403fe0b97c58135162150b4704c80371411ac195.tar.bz2 webtrees-403fe0b97c58135162150b4704c80371411ac195.zip | |
Refactor away find_gedcom_record() - stats
| -rw-r--r-- | library/WT/Stats.php | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/library/WT/Stats.php b/library/WT/Stats.php index 43849b0f01..046c7b9b10 100644 --- a/library/WT/Stats.php +++ b/library/WT/Stats.php @@ -208,9 +208,10 @@ class WT_Stats { function gedcomDate() { global $DATE_FORMAT; - $head=find_other_record('HEAD', $this->_ged_id); - if (preg_match("/1 DATE (.+)/", $head, $match)) { - $date=new WT_Date($match[1]); + $head = WT_GedcomRecord::getInstance('HEAD'); + $fact = $head->getFactByType('DATE'); + if ($fact) { + $date=new WT_Date($fact->getValue()); return $date->Display(false, $DATE_FORMAT); // Override $PUBLIC_DATE_FORMAT } return ''; |
