In ActiveAdmin dates are printed in the, supposedly American, format %B %d, %Y %H:%M
. E.g. March 19, 2013 13:25
However, my "default" frontend prints this using the default Rails (ISO) format, 2013-03-07 14:12:31 UTC
, as seen when dropping a <%= Date.new %>
anywhere in a view.
Active Admin is a framework for creating administration style interfaces. It abstracts common business application patterns to make it simple for developers to implement beautiful and elegant interfaces with very little effort.
please, ensure you have next lines in your config/locales/en.yml
en:
date:
formats:
long: "%Y-%m-%d"
time:
formats:
long: "%Y-%m-%d %H:%M:%S"
Also if you want to change Filter default date formats Try this Active Admin date filter date format customisation
What is defining the format for the ActiveAdmin dates?
From the Localize Format For Dates and Times section of the configuration docs:
Active Admin sets
:long
as default localize format for dates and times.
Source: General Configuration - Localize Format For Dates and Times.
Where or how can this be changed, if possible, simply following a global Rails wide i18n setting.
From ActiveAdmin v1.0.0.pre2 you can override the default localize_format
configuration to use a different format:
ActiveAdmin.setup do |config|
config.localize_format = :short
end
Alternatively you can update the :long
format in your locales configuration as suggested by Fivell:
en:
date:
formats:
long: "%Y-%m-%d"
time:
formats:
long: "%Y-%m-%d %H:%M:%S"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With