title: Rails - format date_field
body: <p>how can I style the date format of a date_field?</p>
  
  <p>I got the following form:</p>
  
  <pre><code>&lt;%= form_for([@user, @vehicle]) do |f| %&gt;
      &lt;%= f.label :name, "Vehicle name" %&gt;
      &lt;%= f.text_field :name, class: 'form-control' %&gt;
      &lt;%= f.label :matriculation_date %&gt;
      &lt;%= f.date_field :matriculation_date, class: 'form-control' %&gt;
      &lt;%= f.submit "Add", class: "btn btn-primary" %&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>this is rendering the following HTML for the date field:</p>
  
  <p><code>&lt;input class="form-control" type="date" name="vehicle[matriculation_date]" id="vehicle_matriculation_date"&gt;</code></p>
  
  <p>The date field accept input in the following format: <code>mm/dd/yyyy</code>. I want it to accept format like <code>dd/mm/yyyy</code>.</p>
  
  <p>I tried to edit it.yml file without any luck.</p>
  
  <pre><code>it:
    date:
        formats:
          default: ! '%d/%m/%Y'
  
    datetime:
        formats:
          default: ! '%d/%m/%Y %H:%M'
  </code></pre>
  
  <p>Any clue? Thank you</p>
  
  <h2>EDIT</h2>
  
  <p>None of the proposed solutions solve my problem, so I think my question was not very clear. What I want is just to style how the date_field prompt the user (see image for more details). At the moment the form show <code>mm/dd/yyyy</code>, and I want it to show <code>dd/mm/yyyy</code>.</p>
  
  <p>Not sure it might be a useful information, but I'm using Bootstrap for styling.</p>
  
  <p><a href="https://i.stack.imgur.com/hN4u9.png" rel="noreferrer"><img src="https://i.stack.imgur.com/hN4u9.png" alt="enter image description here"></a></p>