rails/rails — pull request #5503 by jeyb (2012-03-19 04:06:42+00:00)
Title: Fixes issue #5222: DateTimeSelector builds invalid dates on leap days

The original [commit](https://github.com/rails/rails/commit/0cf79f07b0be7bb9912dfe2a9f2f4c45d98ac41e) made 5 years ago set the day to the 1st when month is excluded, to prevent selecting dates such as February 30th.

However, on leap days if month and day are excluded, you are given 2/29. Changing the year to a non-leap year would not trigger the day reset as mentioned in issue #5222.

It makes sense to consistently set the day to the 1st when its excluded. I could change this to only reset on leap years, but this solution seemed better IMO.