ConstructionConsent: added birthdate

This commit is contained in:
Frank Schubert
2025-02-13 16:36:25 +01:00
parent 2acebb99af
commit 1bc7b47b4f
2 changed files with 19 additions and 7 deletions
@@ -89,6 +89,16 @@ class ConstructionConsentOwnerController extends mfBaseController
$data["phone2"] = $r->phone2;
$data["fax"] = $r->fax;
$data["email"] = $r->email;
$date["birthdate"] = null;
if($r->birthdate) {
try {
$birthdate = DateTime::createFromFormat("d.m.Y", $r->birthdate, new DateTimeZone("Europe/Vienna"));
$data["birthdate"] = $birthdate->format("Y-m-d");
} catch(Exception $e) {
$this->layout()->setFlash("Ungültiges Geburtsdateum", "warning");
}
}
if($mode == "add") {
$data["status"] = "new";