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

Closed
lighthouse-import opened this Issue May 16, 2011 · 3 comments

Comments

Projects
None yet
1 participant
@lighthouse-import

Imported from Lighthouse. Original ticket at: http://rails.lighthouseapp.com/projects/8994/tickets/6589
Created by Edward Ocampo-Gooding - 2011-03-17 04:29:10 UTC

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.

@lighthouse-import

This comment has been minimized.

Show comment Hide comment
@lighthouse-import

lighthouse-import May 16, 2011

Imported from Lighthouse.
Comment by Diego Carrion - 2011-03-17 17:04:41 UTC

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

Imported from Lighthouse.
Comment by Diego Carrion - 2011-03-17 17:04:41 UTC

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

@lighthouse-import

This comment has been minimized.

Show comment Hide comment
@lighthouse-import

lighthouse-import May 16, 2011

Imported from Lighthouse.
Comment by Edward Ocampo-Gooding - 2011-03-17 17:16:14 UTC

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

Imported from Lighthouse.
Comment by Edward Ocampo-Gooding - 2011-03-17 17:16:14 UTC

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

@lighthouse-import

This comment has been minimized.

Show comment Hide comment
@lighthouse-import

lighthouse-import May 16, 2011

Imported from Lighthouse.
Comment by 2kan - 2011-03-21 14:53:24 UTC

Edward, it is not a bug. It is how it is designed: https://github.com/rails/rails/blob/master/actionpack/lib/action_view/helpers/date_helper.rb#L619

Yes, maybe it looks strange a bit, but I don't think that it is a good idea to change it now.

Imported from Lighthouse.
Comment by 2kan - 2011-03-21 14:53:24 UTC

Edward, it is not a bug. It is how it is designed: https://github.com/rails/rails/blob/master/actionpack/lib/action_view/helpers/date_helper.rb#L619

Yes, maybe it looks strange a bit, but I don't think that it is a good idea to change it now.

hisas pushed a commit to hisas/rails that referenced this issue May 9, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment