Skip to content

Commit c7ac26b

Browse files
Fixed validation of empty date/time input fields (#32)
1 parent db81b15 commit c7ac26b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Controls/DateTime/AbstractDateTimeInput.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,10 @@ public function getRawValue()
218218
*/
219219
protected function getValueAsDateTimeImmutable()
220220
{
221+
if ($this->value === null || $this->value === '') {
222+
return null;
223+
}
224+
221225
$date = $this->parser->parse($this->value);
222226
if ($date === null) {
223227
$this->addError($this->invalidValueMessage);

0 commit comments

Comments
 (0)