forked from activeadmin/activeadmin
-
Notifications
You must be signed in to change notification settings - Fork 0
Change datepicker I18n
stasou edited this page Apr 5, 2017
·
5 revisions
Source : https://github.com/joliss/jquery-ui-rails#i18n
To change the translation of the datepicker, just add this require in active_admin.js.coffee :
#= require jquery-ui/i18n/datepicker-pt-BR
List of available translations : https://github.com/joliss/jquery-ui-rails/tree/master/app/assets/javascripts/jquery-ui
f.input :my_date_field, as: :datepicker, datepicker_options: {dateFormat: 'dd/mm/yy'}
In order to always return an ISO formatted date to the server when form submitting (and displaying the given date format to the user), this input do the job :
https://gist.github.com/fabien-michel/bdf427d4f9e6259d3dc2#file-datepicker_input-rb