Describe the bug
I would like to show an entity property of datetime type on the index page of the admin.
I have an entity entry with date filled but its empty on the line.
But if the datetime is null, its shows null.
The formattedValue of the fieldDto is empty.
To Reproduce
symfony 4.4
easyadmin 3.0.1
Create an entity with a datetime property that return a DateTimeInterface
Create a crud from that object.
List the object from the admin menu panel.
(OPTIONAL) Additional context


How strange ... I use DateTime fields in several admins and I can't see this error. Can you please try to debug the cause of the issue? It happens with ALL DateTime properties? Only with DateTimeImmutable? Only with values with certain timezone? etc. Thanks!
It surprised me too. I just start a project with easyadmin with a simple object and I've got this.
I debugged it a bit and I've got the correct datetime template shown with
<time datetime="2020-06-30T22:45:15+00:00" title="Tue, 30 Jun 2020 22:45:15 +0000"></time>
What I noticed its that the value in the element time is empty corresponding to the formattedValue from the template.
<time datetime="{{ field.value|date('c') }}" title="{{ field.value|date('r') }}">{{ field.formattedValue }}</time>
Ok I got this.
I had to enable the php intl extension, otherwhise when calling
$formatter = $this->createDateFormatter($locale, $dateFormat, $timeFormat, $pattern, $date->getTimezone(), $calendar);
in IntlFormatter.php:146 I got the following exception :
Unexpected Symfony\Component\Intl\Exception\MethodNotImplementedException thrown from a caster: The Symfony\Component\Intl\DateFormatter\IntlDateFormatter::getCalendarObject() is not implemented. Please install the "intl" extension for full localization capabilities
Can confirm, installing the intl php extension causes the text to show outside of forms so adding the requirement to composer.json would be nice.
It happened to me too. Looked in multiple places before ending here to find the solution. Installing the intl extension did the job.
Thank you!
Most helpful comment
Ok I got this.
I had to enable the php intl extension, otherwhise when calling
$formatter = $this->createDateFormatter($locale, $dateFormat, $timeFormat, $pattern, $date->getTimezone(), $calendar);in
IntlFormatter.php:146I got the following exception :