From: Matthias Schmidt Date: Sun, 24 Feb 2019 13:29:43 +0000 (+0100) Subject: Add proper nullable support for date form field X-Git-Tag: 5.2.0_Alpha_1~275 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=28d9ce543741bc4aca3f3e52a5c61cee28db0b46;p=GitHub%2FWoltLab%2FWCF.git Add proper nullable support for date form field See #2509 --- diff --git a/wcfsetup/install/files/lib/system/form/builder/field/DateFormField.class.php b/wcfsetup/install/files/lib/system/form/builder/field/DateFormField.class.php index 9f26c3a08d..d2114db3bb 100644 --- a/wcfsetup/install/files/lib/system/form/builder/field/DateFormField.class.php +++ b/wcfsetup/install/files/lib/system/form/builder/field/DateFormField.class.php @@ -1,6 +1,7 @@ getValue() === null) { - return null; + if ($this->isNullable()) { + return null; + } + else { + return DateUtil::getDateTimeByTimestamp(0)->format($this->getSaveValueFormat());; + } } return $this->getValueDateTimeObject()->format($this->getSaveValueFormat());