This project is archived and is in readonly mode.
datetime_select and select_datetime inconsistent for various options
-
Santiago Pastorino
What about this on 3.0?, can you provide the same information for 3.0?
-
Neeraj Singh
For all the below mentioned options, result between datetime_select and select_datetime is consistent in rails3. Nice work rails team.
discard_hour => true
discard_minute => true
discard_second => true
ignore_date => true
discard_month => true -
Neeraj Singh
Now that it it is clear that this issue is only relevant to 2.3.x branch, if it is something that should be fixed then do let me know. I do see that priority is low. However I looked at code and could provide a patch for 2.3.x.
-
Santiago Pastorino
- Milestone set to 2.3.6
- State changed from new to open
- Assigned user changed from Geoff Buesing to Santiago Pastorino
Ok Neeraj Singh, please provide a patch with tests ;)
-
Neeraj Singh
Hi Santiago,
My previous report on everything working fine in rails3 was wrong. Sorry I was in the wrong rvm path.
Here are the cases where result is inconsistent. I have verified that this case exists in both 2.3.5 and in rails3 edge.
discard_hour => true
datetime_select #=> yyyy month day
select_datetime #=> yyyy month day minutesignore_date => true
datetime_select #=> hours minutes
select_datetime #=> yyyy month day hours minutesdiscard_month => true
datetime_select #=> yyyy hours minutes
select_datetime #=> yyyy day hours minutesWorking on it. First I will have a patch for 2.3.x and later for rails3. Sorry about the mistake in the previous report regarding rails3.
-
Santiago Pastorino
- Milestone cleared.
- Tag changed from 2.3.6 to 2.3.6, 3.0, date_select
Can you provide test cases and/or patches for this cases?.
-
Neeraj Singh
- Tag changed from 2.3.6, 3.0, date_select to 2.3.6, 3.0, date_select, patch
Attached is a patch against rails edge which brings more consistency between date helper methods.
without patch ============= no options f.datetime_select : 2010 April 29 - 04 : 21 select_datetime : 2010 April 29 04 21 ( no dash no colon) :discard_hour => true f.datetime_select : 2010 April 29 select_datetime : 2010 April 29 31 :discard_month => true f.datetime_select : 2010 - 04 : 21 select_datetime : 2010 29 04 21 with patch ============= no options f.datetime_select : 2010 April 29 - 04 : 21 select_datetime : 2010 April 29 - 00 : 21 :discard_hour => true f.datetime_select : 2010 April 29 select_datetime : 2010 April 29 :discard_month => true f.datetime_select : 2010 - 04 : 21 select_datetime : 2010 - 00 : 21
Similar type of inconsistencies have been fixed for date_select and time_select.
If you want to test some of these then you can put following code in your erb .
http://gist.github.com/383178formatting was getting messed up hence I used gist.
-
Repository
- State changed from open to resolved
(from [68c96fad55fb13164e339426d7f1cbc88d4ccc8b]) Fix form builder and form helpers inconsistencies [#4432 datetime_select and select_datetime inconsistent for various options state:resolved]
- datetime_select and select_datetime should be consistent as much as possible
- date_select and select_date should be consistent as much as possible
- time_select and select_time should be consistent as much as possible
Signed-off-by: José Valim jose.valim@gmail.com
http://github.com/rails/rails/commit/68c96fad55fb13164e339426d7f1cb... -
Santiago Pastorino
- Milestone set to 2.3.6
- State changed from resolved to open
Well done Neeraj Singh can you do the same for 2.3 stable?
-
Neeraj Singh
Hey Santiago,
Attached is patch back ported for 2-3-stable branch.
-
Santiago Pastorino
- Milestone cleared.
- State changed from open to resolved
Neeraj sorry, i didn't know that José said to you to not do the backport.
Perhaps on 2.4 this could be fixed :P. -
Neeraj Singh
Attached is patch against rails3. I forgot to remove a statement from the last patch.
-
José Valim
- State changed from resolved to open
- Assigned user changed from Santiago Pastorino to José Valim
-
Repository
- State changed from open to resolved
(from [a003a39bac204b6b2d6425fa3c10891a0cf0149a]) removing the extra assignment statement [#4432 datetime_select and select_datetime inconsistent for various options state:resolved]
Signed-off-by: José Valim jose.valim@gmail.com
http://github.com/rails/rails/commit/a003a39bac204b6b2d6425fa3c1089...
