Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

date_select’s :discard_month and :discard_day choose different default days

#6589

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.

Reported by Edward Ocampo-Gooding · March 17th, 2011 @ 04:29 AM

State: new
Milestone: none
Assigned to: nobody
Importance: none

Activity

  1. Diego Carrion
    Diego Carrion

    When using discard_day, the day chosen is the first day of the month to avoid things like 31/02/2011.

    March 17th, 2011 @ 05:04 PM

  2. Edward Ocampo-Gooding
    Edward Ocampo-Gooding

    Diego: right, except that when :discard_month implicitly sets :discard_day, the first day of the month is not chosen.

    March 17th, 2011 @ 05:16 PM

  3. 2kan
    2kan

    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.

    March 21st, 2011 @ 02:53 PM