This project is archived and is in readonly mode.

#4432 ✓resolved
Neeraj

datetime_select and select_datetime inconsistent for various options

Reported by Neeraj | April 18th, 2010 @ 03:16 AM | in 3.0.2

I tested following case with edge 2-3-stable branch.

discard_hour => true
datetime_select #=> yyyy month day
select_datetime #=> yyyy month day minutes
result is inconsistent

discard_minute => true
datetime_select #=> yyyy month day hours
select_datetime #=> yyyy month day hours
result is consistent

discard_second => true
datetime_select #=> yyyy month day hours minutes
select_datetime #=> yyyy month day hours minutes
result is consistent

ignore_date => true
datetime_select #=> hours minutes
select_datetime #=> yyyy month day hours minutes
result is inconsistent

discard_month => true
datetime_select #=> yyyy hours minutes
select_datetime #=> yyyy day hours minutes
result is inconsistent

I have not listed a few more cases where the result is inconsistent.

For the methods datetime_select and select_datetime which are mirror image methods, the expected behavior should be as consistent as possible.

Please let me know if it is something that should be fixed. I can put in a patch if I get a go ahead.

I actually wanted to fix ticket #1004 https://rails.lighthouseapp.com/projects/8994/tickets/1004-datetime... . However if this inconsistency is removed then code would be more streamlined and it would easier to patch ticket #1004.

Comments and changes to this ticket

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>

Referenced by

Pages