sferik/rails_admin — pull request #2010 by lksv (2014-06-16 11:59:37+00:00)
Title: fix parsing datetime for locales

fix datetime to normalize correctly even when one month name (or weekday
name) is substring of another.

It is at least in Czech:
* June (červen) is a substring of Juny (červenec)

I did not create a tests. It should be done like:

it 'is able to read %B %d, %Y %H:%M for cs locate' do
# in Czech June (červen) is a substring of Juny (červenec)
@time = ::Time.new(2014,7,21,23,45).getutc
I18n.with_locale(:cs) do
puts I18n.l @time
@object = FactoryGirl.create(:field_test)
@object.datetime_field = @field.parse_input(datetime_field: @time.strftime('%B %d, %Y %H:%M'))
expect(@object.datetime_field.strftime('%Y-%m-%d %H:%M')).to eq(@time.strftime('%Y-%m-%d %H:%M'))
end
end

But it is not good idea to include Czech locale to the project. What is the best way to test it?