This project is archived and is in readonly mode.
date_select’s :discard_month and :discard_day choose different default days
Reported by Edward Ocampo-Gooding | March 17th, 2011 @ 04:29 AM
When setting :discard_day
as an option in the
date_select
view helper, the default day chosen is the
first of the month.
However, when setting :discard_month
, and it
implicitly sets :discard_day
, the default day chosen
is the current day instead of the first of the month.
Which behaviour is correct? Either way, that feels like a bug.
Comments and changes to this ticket
-
Diego Carrion March 17th, 2011 @ 05:04 PM
When using discard_day, the day chosen is the first day of the month to avoid things like 31/02/2011.
-
Edward Ocampo-Gooding March 17th, 2011 @ 05:16 PM
Diego: right, except that when :discard_month implicitly sets :discard_day, the first day of the month is not chosen.
-
2kan March 21st, 2011 @ 02:53 PM
Edward, it is not a bug. It is how it is designed: https://github.com/rails/rails/blob/master/actionpack/lib/action_vi...
Yes, maybe it looks strange a bit, but I don't think that it is a good idea to change it now.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>