Skip to content

Commit

Permalink
Only use i18n date order if one exists.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomas Jogin authored and justinfrench committed Oct 7, 2009
1 parent 378e888 commit 8408099
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/formtastic.rb
Expand Up @@ -747,7 +747,8 @@ def time_input(method, options)
#
def date_or_datetime_input(method, options)
position = { :year => 1, :month => 2, :day => 3, :hour => 4, :minute => 5, :second => 6 }
inputs = options.delete(:order) || I18n.translate(:'date.order') || [:year, :month, :day]
i18n_date_order = I18n.translate(:'date.order').is_a? Array ? I18n.translate(:'date.order') : nil
inputs = options.delete(:order) || i18n_date_order || [:year, :month, :day]

time_inputs = [:hour, :minute]
time_inputs << [:second] if options[:include_seconds]
Expand Down

0 comments on commit 8408099

Please sign in to comment.