diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-01-24 16:37:39 -0200 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-01-24 16:38:08 -0200 |
commit | c4b7ca06a4f80983a531b1e5094043be1e13f53a (patch) | |
tree | ec3502e0185dda11d11c48b29fa53acb16ff6a0e /actionpack/lib/action_view/helpers/date_helper.rb | |
parent | d92b5fe07cc178f14bdd5a4ecf4adb8b96dcdd7e (diff) | |
download | rails-c4b7ca06a4f80983a531b1e5094043be1e13f53a.tar.gz rails-c4b7ca06a4f80983a531b1e5094043be1e13f53a.tar.bz2 rails-c4b7ca06a4f80983a531b1e5094043be1e13f53a.zip |
Fix date_select with discard_month and discard_year options
Closes #4553 and #4633
Diffstat (limited to 'actionpack/lib/action_view/helpers/date_helper.rb')
-rw-r--r-- | actionpack/lib/action_view/helpers/date_helper.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/actionpack/lib/action_view/helpers/date_helper.rb b/actionpack/lib/action_view/helpers/date_helper.rb index 3464f2d461..656564c106 100644 --- a/actionpack/lib/action_view/helpers/date_helper.rb +++ b/actionpack/lib/action_view/helpers/date_helper.rb @@ -742,7 +742,7 @@ module ActionView def select_month if @options[:use_hidden] || @options[:discard_month] - build_hidden(:month, month) + build_hidden(:month, month || 1) else month_options = [] 1.upto(12) do |month_number| @@ -756,7 +756,7 @@ module ActionView def select_year if !@datetime || @datetime == 0 - val = '' + val = '1' middle_year = Date.today.year else val = middle_year = year |