diff options
author | Thibaud Guillaume-Gentil <thibaud@thibaud.me> | 2010-06-14 12:17:42 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-06-20 12:33:02 +0200 |
commit | 5522578d1631abf1851ed6ff3079ffae3a289b53 (patch) | |
tree | 1e9a8c7a53fdf19f429762bacc5df1234ed46279 /actionpack/lib/action_view | |
parent | d06105063829d44adf641059ef97f54d7b690f4b (diff) | |
download | rails-5522578d1631abf1851ed6ff3079ffae3a289b53.tar.gz rails-5522578d1631abf1851ed6ff3079ffae3a289b53.tar.bz2 rails-5522578d1631abf1851ed6ff3079ffae3a289b53.zip |
Fixed date_select date_separator when discard_month and/or discard_day are true [#4856 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'actionpack/lib/action_view')
-rw-r--r-- | actionpack/lib/action_view/helpers/date_helper.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/actionpack/lib/action_view/helpers/date_helper.rb b/actionpack/lib/action_view/helpers/date_helper.rb index 7d846a01dd..8a97058abb 100644 --- a/actionpack/lib/action_view/helpers/date_helper.rb +++ b/actionpack/lib/action_view/helpers/date_helper.rb @@ -894,8 +894,10 @@ module ActionView # Returns the separator for a given datetime component def separator(type) case type - when :month, :day - @options[:date_separator] + when :month + @options[:discard_month] ? "" : @options[:date_separator] + when :day + @options[:discard_day] ? "" : @options[:date_separator] when :hour (@options[:discard_year] && @options[:discard_day]) ? "" : @options[:datetime_separator] when :minute |