diff options
-rwxr-xr-x | actionpack/lib/action_view/helpers/date_helper.rb | 2 |
1 files changed, 1 insertions, 1 deletions
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 |