summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--library/WT/Stats.php7
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 '';