diff options
| author | Greg Roach <fisharebest@gmail.com> | 2015-09-27 09:12:22 +0100 |
|---|---|---|
| committer | Greg Roach <fisharebest@gmail.com> | 2015-09-27 09:12:22 +0100 |
| commit | 44f3c1494a4da70175ffd2d40aa661783f529868 (patch) | |
| tree | 10cb5d30ed279aa3eb56423db0b7ab1227da7d40 /app/Census/CensusColumnMonthIfMarriedWithinYear.php | |
| parent | a53db70de9092a80529e77db445001f1acf43696 (diff) | |
| download | webtrees-44f3c1494a4da70175ffd2d40aa661783f529868.tar.gz webtrees-44f3c1494a4da70175ffd2d40aa661783f529868.tar.bz2 webtrees-44f3c1494a4da70175ffd2d40aa661783f529868.zip | |
Unit tests
Diffstat (limited to 'app/Census/CensusColumnMonthIfMarriedWithinYear.php')
| -rw-r--r-- | app/Census/CensusColumnMonthIfMarriedWithinYear.php | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/app/Census/CensusColumnMonthIfMarriedWithinYear.php b/app/Census/CensusColumnMonthIfMarriedWithinYear.php index 0750ba16d9..259594af23 100644 --- a/app/Census/CensusColumnMonthIfMarriedWithinYear.php +++ b/app/Census/CensusColumnMonthIfMarriedWithinYear.php @@ -29,6 +29,15 @@ class CensusColumnMonthIfMarriedWithinYear extends AbstractCensusColumn implemen * @return string */ public function generate(Individual $individual) { + foreach ($individual->getSpouseFamilies() as $family) { + foreach ($family->getFacts('MARR') as $fact) { + if ($fact->getDate()->julianDay() + 365 >= $this->date()->julianDay()) { + // Use the GEDCOM month, as we need this in English - for the US census + return ucfirst(strtolower($fact->getDate()->minimumDate()->format('%O'))); + } + } + } + return ''; } } |
