Skip to content

Commit 3f331f6

Browse files
committed
do not convert empty datetimes to datetime
1 parent 2908a71 commit 3f331f6

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
## [0.2.13] - 2026-06-30
6+
- Fixed: creating invalid datetime for empty datetime fields values
7+
58
## [0.2.12] - 2026-03-16
69
- Fixed: bc break with symfony 5 in 0.2.11
710

src/EventListener/FormGeneratorListener.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,9 @@ public function onPrepareFormData(array &$submittedData, array &$labels, array $
196196
}
197197

198198
if (\in_array($formField->rgxp, ['date', 'time', 'datim'])) {
199+
if ('' === $data) {
200+
continue;
201+
}
199202
$objDate = new Date($data, Date::getFormatFromRgxp($formField->rgxp));
200203
$submittedData[$formField->name] = $objDate->tstamp;
201204
}

0 commit comments

Comments
 (0)