aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/helpers/date_helper.rb
diff options
context:
space:
mode:
authorPratik Naik <pratiknaik@gmail.com>2008-11-06 01:07:10 +0530
committerPratik Naik <pratiknaik@gmail.com>2008-11-06 01:07:10 +0530
commit215122890b8cecca3809d981accd84bfd5486196 (patch)
tree11dd8368e2674342098af21136893bee491c44ff /actionpack/lib/action_view/helpers/date_helper.rb
parent94f3a94b0b66e576287f48627282dc1a21bf51a7 (diff)
parent32089cbcc9ca3fb935f783e7a7ef2b60b7d43006 (diff)
downloadrails-215122890b8cecca3809d981accd84bfd5486196.tar.gz
rails-215122890b8cecca3809d981accd84bfd5486196.tar.bz2
rails-215122890b8cecca3809d981accd84bfd5486196.zip
Merge commit 'mainstream/master'
Diffstat (limited to 'actionpack/lib/action_view/helpers/date_helper.rb')
-rw-r--r--actionpack/lib/action_view/helpers/date_helper.rb4
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 d4d2c6ef53..919c937444 100644
--- a/actionpack/lib/action_view/helpers/date_helper.rb
+++ b/actionpack/lib/action_view/helpers/date_helper.rb
@@ -539,7 +539,7 @@ module ActionView
# If the day is hidden and the month is visible, the day should be set to the 1st so all month choices are
# valid (otherwise it could be 31 and february wouldn't be a valid date)
- if @options[:discard_day] && !@options[:discard_month]
+ if @datetime && @options[:discard_day] && !@options[:discard_month]
@datetime = @datetime.change(:day => 1)
end
@@ -567,7 +567,7 @@ module ActionView
# If the day is hidden and the month is visible, the day should be set to the 1st so all month choices are
# valid (otherwise it could be 31 and february wouldn't be a valid date)
- if @options[:discard_day] && !@options[:discard_month]
+ if @datetime && @options[:discard_day] && !@options[:discard_month]
@datetime = @datetime.change(:day => 1)
end
end