Skip to content

DateInterval as a textfield creates issues and can't be edited. #7374

@npielawski

Description

@npielawski

Describe the bug
The doc shows that the Doctrine DateInterval should be a TextField in easy admin, but doing so breaks the page. There is a translation layer that is missing to go from a string to a DateInterval.

The exact error is:

The value of the "duration" field of the entity with ID = "1" can't be converted into a string, so it cannot be represented by a TextField or a TextareaField.

I just started using EasyAdmin, so I don't know if there is an easy solution. I tried to use formatValue, to no avail.

To Reproduce

  1. Create an entity which contains a DateInterval type variable
  2. Create a CRUD controller a configure the field to be a TextField.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions