xref: /webtrees/app/Census/CensusColumnBirthMonth.php (revision 3976b4703df669696105ed6b024b96d433c8fbdb)
1f3fa6d90SGreg Roach<?php
2*3976b470SGreg Roach
3f3fa6d90SGreg Roach/**
4f3fa6d90SGreg Roach * webtrees: online genealogy
58fcd0d32SGreg Roach * Copyright (C) 2019 webtrees development team
6f3fa6d90SGreg Roach * This program is free software: you can redistribute it and/or modify
7f3fa6d90SGreg Roach * it under the terms of the GNU General Public License as published by
8f3fa6d90SGreg Roach * the Free Software Foundation, either version 3 of the License, or
9f3fa6d90SGreg Roach * (at your option) any later version.
10f3fa6d90SGreg Roach * This program is distributed in the hope that it will be useful,
11f3fa6d90SGreg Roach * but WITHOUT ANY WARRANTY; without even the implied warranty of
12f3fa6d90SGreg Roach * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13f3fa6d90SGreg Roach * GNU General Public License for more details.
14f3fa6d90SGreg Roach * You should have received a copy of the GNU General Public License
15f3fa6d90SGreg Roach * along with this program. If not, see <http://www.gnu.org/licenses/>.
16f3fa6d90SGreg Roach */
17e7f56f2aSGreg Roachdeclare(strict_types=1);
1815d603e7SGreg Roach
19f3fa6d90SGreg Roachnamespace Fisharebest\Webtrees\Census;
20f3fa6d90SGreg Roach
21f3fa6d90SGreg Roachuse Fisharebest\Webtrees\Individual;
22f3fa6d90SGreg Roach
23f3fa6d90SGreg Roach/**
24f3fa6d90SGreg Roach * The individual's date of birth.
25f3fa6d90SGreg Roach */
26c1010edaSGreg Roachclass CensusColumnBirthMonth extends AbstractCensusColumn implements CensusColumnInterface
27c1010edaSGreg Roach{
28f3fa6d90SGreg Roach    /**
29f3fa6d90SGreg Roach     * Generate the likely value of this census column, based on available information.
30f3fa6d90SGreg Roach     *
31f3fa6d90SGreg Roach     * @param Individual $individual
3215d603e7SGreg Roach     * @param Individual $head
33f3fa6d90SGreg Roach     *
34f3fa6d90SGreg Roach     * @return string
35f3fa6d90SGreg Roach     */
368f53f488SRico Sonntag    public function generate(Individual $individual, Individual $head): string
37c1010edaSGreg Roach    {
38f3fa6d90SGreg Roach        return $individual->getEstimatedBirthDate()->minimumDate()->format('%M');
39f3fa6d90SGreg Roach    }
40f3fa6d90SGreg Roach}
41