In the entity the date time is decalared:
/**
* @var \DateTime
* @ORM\Column(name="task_date_start", type="datetime", nullable=true)
*/
private $taskDateStart;
in the form
$builder->add('taskDateStart', DateType::class, [
"widget" => "single_text",
"html5" => false,
"format" => "dd-MM-yyyy" ,
"attr" => ["class" => "js-datepicker"],
"required" => false
]);
i've this error when inserting null in to the field
Argument 1 passed to ... must be an instance of DateTime, null given