aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/helpers/date_helper.rb
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2012-01-24 11:35:11 -0800
committerJosé Valim <jose.valim@gmail.com>2012-01-24 20:46:24 +0100
commitc973fc71254410fcab7d4560599f719b9e58a216 (patch)
treeff807c3fa7fd9bacf03d1c0ac3c88715ec85abbb /actionpack/lib/action_view/helpers/date_helper.rb
parent8478b0ca0b90bcf4210bf82938d73112d2e6b010 (diff)
downloadrails-c973fc71254410fcab7d4560599f719b9e58a216.tar.gz
rails-c973fc71254410fcab7d4560599f719b9e58a216.tar.bz2
rails-c973fc71254410fcab7d4560599f719b9e58a216.zip
Merge pull request #4641 from rafaelfranca/date_select-fix-3-2
date_select fixes [3-2-stable]
Diffstat (limited to 'actionpack/lib/action_view/helpers/date_helper.rb')
-rw-r--r--actionpack/lib/action_view/helpers/date_helper.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/actionpack/lib/action_view/helpers/date_helper.rb b/actionpack/lib/action_view/helpers/date_helper.rb
index e095f832d1..db9f5f5e9d 100644
--- a/actionpack/lib/action_view/helpers/date_helper.rb
+++ b/actionpack/lib/action_view/helpers/date_helper.rb
@@ -734,7 +734,7 @@ module ActionView
def select_day
if @options[:use_hidden] || @options[:discard_day]
- build_hidden(:day, day)
+ build_hidden(:day, day || 1)
else
build_options_and_select(:day, day, :start => 1, :end => 31, :leading_zeros => false, :use_two_digit_numbers => @options[:use_two_digit_numbers])
end
@@ -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