<p dir="auto"><strong>Description</strong></p>
<p dir="auto">Since <a href="https://github.com/symfony/symfony/releases/tag/v2.8.46">v2.8.46</a>, relative dates are not supported anymore by <code class="notranslate">DateTimeType</code>.</p>
<p dir="auto">I am guessing this is because of the patches :</p>
<ul dir="auto">
<li>bug <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="360272444" data-permission-text="Title is private" data-url="https://github.com/symfony/symfony/issues/28466" data-hovercard-type="pull_request" data-hovercard-url="/symfony/symfony/pull/28466/hovercard" href="https://github.com/symfony/symfony/pull/28466">#28466</a> [Form] fail reverse transforming invalid RFC 3339 dates</li>
<li>bug <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="357247177" data-permission-text="Title is private" data-url="https://github.com/symfony/symfony/issues/28372" data-hovercard-type="pull_request" data-hovercard-url="/symfony/symfony/pull/28372/hovercard" href="https://github.com/symfony/symfony/pull/28372">#28372</a> [Form] Fix DateTimeType html5 input format</li>
</ul>
<p dir="auto">It would be great to introduce the feature again by adding a dedicated value of the <code class="notranslate">format</code> option, or anything better you can think of.</p>
<p dir="auto"><strong>Example</strong></p>
<p dir="auto">At <a class="user-mention notranslate" data-hovercard-type="organization" data-hovercard-url="/orgs/lrqdo/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/lrqdo">@lrqdo</a>, the relative dates are helping us simplify our Behat scenarios.</p>
<p dir="auto">Here is an example of a Behat scenario failing on v2.8.46:</p>
<div class="highlight highlight-text-gherkin-feature notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="When I send a POST request to &quot;/endpoint&quot; with values:
  | distributionDate | +14 days |
Then the response code should be 200
  Failed asserting that 400 is identical to 200."><pre class="notranslate"><span class="pl-k">When </span>I send a POST request to <span class="pl-s">"/endpoint"</span> with values:
<span class="pl-k">  | <span class="pl-s1">distributionDate</span> | +<span class="pl-s1">14</span> <span class="pl-s1">days</span> |</span>
<span class="pl-k">Then </span>the response code should be 200
  Failed asserting that 400 is identical to 200.</pre></div>
<p dir="auto">Here is the form type we wrote:</p>
<div class="highlight highlight-text-html-php notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="public function buildForm(FormBuilderInterface $builder, array $options)
{
    $builder-&gt;add(
        'distributionDate',
        DateTimeType::class,
        array(
            'widget' =&gt; 'single_text',
        )
    );
}"><pre class="notranslate"><span class="pl-k">public</span> <span class="pl-k">function</span> <span class="pl-en">buildForm</span>(<span class="pl-smi"><span class="pl-smi">FormBuilderInterface</span></span> <span class="pl-s1"><span class="pl-c1">$</span>builder</span>, <span class="pl-smi">array</span> <span class="pl-s1"><span class="pl-c1">$</span>options</span>)
{
    <span class="pl-s1"><span class="pl-c1">$</span>builder</span>-&gt;<span class="pl-en">add</span>(
        <span class="pl-s">'distributionDate'</span>,
        <span class="pl-v">DateTimeType</span>::class,
        <span class="pl-en">array</span>(
            <span class="pl-s">'widget'</span> =&gt; <span class="pl-s">'single_text'</span>,
        )
    );
}</pre></div>
<p dir="auto">And here is the detailed error we get:</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/181746/46359058-a90e8680-c668-11e8-8f2c-5b3fae984558.png"><img src="https://user-images.githubusercontent.com/181746/46359058-a90e8680-c668-11e8-8f2c-5b3fae984558.png" alt="image" style="max-width: 100%;"></a></p>
<table role="table">
<thead>
<tr>
<th>Q</th>
<th>A</th>
</tr>
</thead>
<tbody>
<tr>
<td>Bug report?</td>
<td>no</td>
</tr>
<tr>
<td>Feature request?</td>
<td>yes</td>
</tr>
<tr>
<td>BC Break report?</td>
<td>no</td>
</tr>
<tr>
<td>RFC?</td>
<td>yes</td>
</tr>
<tr>
<td>Symfony version</td>
<td>4.1</td>
</tr>
</tbody>
</table>
<p dir="auto">SensioFrameworkExtraBundle provides three main features:</p>
<ul dir="auto">
<li>Annotations (<code class="notranslate">@Route()</code>, <code class="notranslate">@Security()</code>, ...)</li>
<li>Param converters</li>
<li>PSR-7</li>
</ul>
<p dir="auto">This proposal is only about annotations. We started moving some annotations into Symfony core, but we only moved one of them and that's why now we have two <code class="notranslate">@Route</code> annotations:</p>
<div class="highlight highlight-text-html-php notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Component\Routing\Annotation\Route;"><pre class="notranslate"><span class="pl-k">use</span> <span class="pl-v">Sensio</span>\<span class="pl-v">Bundle</span>\<span class="pl-v">FrameworkExtraBundle</span>\<span class="pl-v">Configuration</span>\<span class="pl-v">Route</span>;
<span class="pl-k">use</span> <span class="pl-v">Symfony</span>\<span class="pl-v">Component</span>\<span class="pl-v">Routing</span>\<span class="pl-v">Annotation</span>\<span class="pl-v">Route</span>;</pre></div>
<p dir="auto">So, should we move the rest of annotations to avoid mixing namespaces  like this?</p>
<div class="highlight highlight-text-html-php notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="use Symfony\Component\Routing\Annotation\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;"><pre class="notranslate"><span class="pl-k">use</span> <span class="pl-v">Symfony</span>\<span class="pl-v">Component</span>\<span class="pl-v">Routing</span>\<span class="pl-v">Annotation</span>\<span class="pl-v">Route</span>;
<span class="pl-k">use</span> <span class="pl-v">Sensio</span>\<span class="pl-v">Bundle</span>\<span class="pl-v">FrameworkExtraBundle</span>\<span class="pl-v">Configuration</span>\<span class="pl-v">Method</span>;</pre></div>
<p dir="auto">If you agree with this, should we move each annotation to the related package?</p>
<div class="highlight highlight-text-html-php notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\HttpFoundation\Annotation\Method;
use Symfony\Component\Security\Annotation\Security;
// ..."><pre class="notranslate"><span class="pl-k">use</span> <span class="pl-v">Symfony</span>\<span class="pl-v">Component</span>\<span class="pl-v">Routing</span>\<span class="pl-v">Annotation</span>\<span class="pl-v">Route</span>;
<span class="pl-k">use</span> <span class="pl-v">Symfony</span>\<span class="pl-v">Component</span>\<span class="pl-v">HttpFoundation</span>\<span class="pl-v">Annotation</span>\<span class="pl-v">Method</span>;
<span class="pl-k">use</span> <span class="pl-v">Symfony</span>\<span class="pl-v">Component</span>\<span class="pl-v">Security</span>\<span class="pl-v">Annotation</span>\<span class="pl-v">Security</span>;
<span class="pl-c">// ...</span></pre></div>
<p dir="auto">Or should we put all annotations in the same place to make things simple?</p>
<div class="highlight highlight-text-html-php notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="use Symfony\Bridge\Annotation\Route;
use Symfony\Bridge\Annotation\Method;
use Symfony\Bridge\Annotation\Security;
// ..."><pre class="notranslate"><span class="pl-k">use</span> <span class="pl-v">Symfony</span>\<span class="pl-v">Bridge</span>\<span class="pl-v">Annotation</span>\<span class="pl-v">Route</span>;
<span class="pl-k">use</span> <span class="pl-v">Symfony</span>\<span class="pl-v">Bridge</span>\<span class="pl-v">Annotation</span>\<span class="pl-v">Method</span>;
<span class="pl-k">use</span> <span class="pl-v">Symfony</span>\<span class="pl-v">Bridge</span>\<span class="pl-v">Annotation</span>\<span class="pl-v">Security</span>;
<span class="pl-c">// ...</span></pre></div>