Skip to content

Commit

Permalink
Merge pull request #3 from romainguerrero/master
Browse files Browse the repository at this point in the history
Debug array key not exist error in case of date at first level
  • Loading branch information
npotier authored Jul 20, 2017
2 parents 2464e6b + 95ab786 commit a35b92a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Form/Field/FieldBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ public function alterDataPreSetDataEvent($formFields, $builder)
}
}
}
} elseif ("date" == $field->type) {
} elseif ("date" == $field->type && array_key_exists($name, $formData)) {
$dateTimeValue = \DateTime::createFromFormat('Y-m-d H:i:s.u', $formData[$name]['date']);
// try to get the date without milliseconds
if (!$dateTimeValue) {
Expand Down

0 comments on commit a35b92a

Please sign in to comment.