I'm using AA and when I edit an entity which has a date attribute, it's not localized.
I had to add this:
module ActiveAdmin
module Inputs
class UiDatePickerInput < ::ActiveAdmin::Inputs::DatepickerInput
def input_html_options
options = super
options[:class] = [options[:class], "ui-date-picker"].compact.join(' ')
options[:value] = localized(value)
options
end
def localized value
value.nil? ? nil : I18n.localize(object.send(method))
end
def value
input_options[:value] || object.send(method).try(:strftime, format)
end
def format
input_options[:format] || '%d %b %Y'
end
end
end
end
I'm using AA and when I edit an entity which has a date attribute, it's not localized.
I had to add this:
in an initializer to make it work