3 namespace wcf\system\event\listener;
5 use wcf\acp\form\PersonAddForm;
6 use wcf\form\AbstractFormBuilderForm;
7 use wcf\system\form\builder\container\FormContainer;
8 use wcf\system\form\builder\field\DateFormField;
11 * Handles setting the birthday when adding and editing people.
13 * @author Matthias Schmidt
14 * @copyright 2001-2021 WoltLab GmbH
15 * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
16 * @package WoltLabSuite\Core\System\Event\Listener
18 class BirthdayPersonAddFormListener extends AbstractEventListener
21 * @see AbstractFormBuilderForm::createForm()
23 protected function onCreateForm(PersonAddForm $form): void
25 /** @var FormContainer $dataContainer */
26 $dataContainer = $form->form->getNodeById('data');
27 $dataContainer->appendChild(
28 DateFormField::create('birthday')
29 ->label('wcf.person.birthday')
30 ->saveValueFormat('Y-m-d')