diff options
Diffstat (limited to 'app/Census/CensusColumnMonthIfBornWithinYear.php')
| -rw-r--r-- | app/Census/CensusColumnMonthIfBornWithinYear.php | 40 |
1 files changed, 21 insertions, 19 deletions
diff --git a/app/Census/CensusColumnMonthIfBornWithinYear.php b/app/Census/CensusColumnMonthIfBornWithinYear.php index 09d0f5feef..6f2cc82fd0 100644 --- a/app/Census/CensusColumnMonthIfBornWithinYear.php +++ b/app/Census/CensusColumnMonthIfBornWithinYear.php @@ -21,23 +21,25 @@ use Fisharebest\Webtrees\Individual; /** * The month of birth, if within the last year. */ -class CensusColumnMonthIfBornWithinYear extends AbstractCensusColumn implements CensusColumnInterface { - /** - * Generate the likely value of this census column, based on available information. - * - * @param Individual $individual - * @param Individual $head - * - * @return string - */ - public function generate(Individual $individual, Individual $head = null) { - $birth_jd = $individual->getBirthDate()->julianDay(); - $census_jd = $this->date()->julianDay(); - if ($birth_jd <= $census_jd && $birth_jd >= $census_jd - 365) { - // Use the GEDCOM month, as we need this in English - for the US census - return ucfirst(strtolower($individual->getBirthDate()->minimumDate()->format('%O'))); - } else { - return ''; - } - } +class CensusColumnMonthIfBornWithinYear extends AbstractCensusColumn implements CensusColumnInterface +{ + /** + * Generate the likely value of this census column, based on available information. + * + * @param Individual $individual + * @param Individual $head + * + * @return string + */ + public function generate(Individual $individual, Individual $head = null) + { + $birth_jd = $individual->getBirthDate()->julianDay(); + $census_jd = $this->date()->julianDay(); + if ($birth_jd <= $census_jd && $birth_jd >= $census_jd - 365) { + // Use the GEDCOM month, as we need this in English - for the US census + return ucfirst(strtolower($individual->getBirthDate()->minimumDate()->format('%O'))); + } else { + return ''; + } + } } |
