mirror of
https://github.com/github/rails.git
synced 2026-01-31 09:18:17 -05:00
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
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user