This question is relative to The DateIntervalType field type introduced in Symfony 3.2. This field allows the user to select an interval of time in a form.
I would like to know its corresponding doctrine type and how to format it in twig as for example 2 hours and 30 minutes ?
Thanks!
The doctrine dbal (which is used by doctrine orm) supports dateinterval already. Here is the link: http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/types.html#dateinterval
Display a dateinterval with twig is really easy, just use the
date
filter which internally use theDateInterval::format
method.