0
I know there is how to edit in the location, to pass it to the Brazilian format. But I do not know the syntax to change the format in the form:
<div class="field">
<p> Garantia </p>
<%= f.date_select :guarantee %>
</div>
0
I know there is how to edit in the location, to pass it to the Brazilian format. But I do not know the syntax to change the format in the form:
<div class="field">
<p> Garantia </p>
<%= f.date_select :guarantee %>
</div>
2
Put in your config/application.rb
Time::DATE_FORMATS[:default] = "%d/%m/%Y %H:%M"
Date::DATE_FORMATS[:default] = "%d/%m/%Y"
That the formatting of all system dates go to the Brazilian standard.
Thank you Luiz Carvalho. Problem solved.
-1
I was looking about dates and dropped here, for you to use in the Brazilian long format with the I18n is very interesting:
I18n.l(Time.now, format: "%d de %B de %Y") # 27 de fevereiro de 2021
Browser other questions tagged ruby-on-rails ruby
You are not signed in. Login or sign up in order to post.
Look if it can help you. http://stackoverflow.com/questions/1449955/rails-date-format-in-a-text-field
– Marconi
I think this is an HTML issue, isn’t it? What kind of input does the
date_select
generates?– user3603
Managed to solve the problem?
– user3603
@ygorbr Managed to solve the problem?
– user3603