From: Marcel Werk Date: Tue, 19 Nov 2024 13:32:22 +0000 (+0100) Subject: Fix empty time filter selections X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e940d30d83c61da032ed101692fe7f6d4c2a1812;p=GitHub%2FWoltLab%2FWCF.git Fix empty time filter selections --- diff --git a/wcfsetup/install/files/lib/system/form/builder/field/DateRangeFormField.class.php b/wcfsetup/install/files/lib/system/form/builder/field/DateRangeFormField.class.php index 96d8a26666..accb3f29ef 100644 --- a/wcfsetup/install/files/lib/system/form/builder/field/DateRangeFormField.class.php +++ b/wcfsetup/install/files/lib/system/form/builder/field/DateRangeFormField.class.php @@ -50,7 +50,7 @@ class DateRangeFormField extends AbstractFormField implements */ public function getSaveValue() { - if ($this->getValue() === null && $this->isNullable()) { + if (!$this->getFromValue() && !$this->getToValue() && $this->isNullable()) { return null; } diff --git a/wcfsetup/install/files/lib/system/gridView/filter/TimeFilter.class.php b/wcfsetup/install/files/lib/system/gridView/filter/TimeFilter.class.php index 91a1889e3d..0aa876635f 100644 --- a/wcfsetup/install/files/lib/system/gridView/filter/TimeFilter.class.php +++ b/wcfsetup/install/files/lib/system/gridView/filter/TimeFilter.class.php @@ -22,6 +22,7 @@ class TimeFilter implements IGridViewFilter { return DateRangeFormField::create($id) ->label($label) + ->nullable() ->supportTime(); }