From 1ddaec1e68ae35509d665dbfc5d7f9ae87f41962 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Fri, 15 Jun 2007 01:58:32 +0000 Subject: Only change date to beginning of month if it isn't nil. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7027 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/lib/action_view/helpers/date_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'actionpack/lib/action_view/helpers') diff --git a/actionpack/lib/action_view/helpers/date_helper.rb b/actionpack/lib/action_view/helpers/date_helper.rb index c686982056..6ab2596439 100755 --- a/actionpack/lib/action_view/helpers/date_helper.rb +++ b/actionpack/lib/action_view/helpers/date_helper.rb @@ -389,7 +389,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 discard[:day] && !discard[:month] + if datetime && discard[:day] && !discard[:month] datetime = datetime.change(:day => 1) end -- cgit v1.2.3