Assert date validation error [symfony]
<p>When I'm trying validate $date with assert, like this :
@Assert\Date()</p>
<pre><code> /**
 * @ORM\Column(type=&quot;date&quot;)
 * @DatagridColumn(sortable=TRUE)
 * @Assert\Date()
 * @Assert\NotBlank()
 */
private $date;
</code></pre>
<p>But I have an error :</p>
<blockquote>
<p>Error: Call to a member function format() on string</p>
<p>500 Internal Server Error - FatalErrorException</p>
</blockquote>
<p>Does anyone know, why it's happening ?</p>
<blockquote>
<p>From documentation: TYPE could be string.</p>
</blockquote>
<p>I also checked the format using dump() and it's correct &gt; YYYY-MM-DD</p>
<p>Without validation it works correct.</p>
<p>Thank you for any information</p>