Hi All I''m attempting to make a simple time select field so I thought I just needed a datetime_select with the option :discard_year => true. However, every ''discard'' option except discard_year seems to work. So I''m left with a year, hour and minute to select. Could anyone please point me in the right direction? Much appreciated. Doug -- Posted via http://www.ruby-forum.com/.
Doug <doug.bromley@...> writes:> > Hi All > > I''m attempting to make a simple time select field so I thought I just > needed a datetime_select with the option :discard_year => true. > > However, every ''discard'' option except discard_year seems to work. So > I''m left with a year, hour and minute to select. > > Could anyone please point me in the right direction? > > Much appreciated. > > DougHi Doug, I ran across this recently and found some known bugs: http://dev.rubyonrails.org/ticket/1175 http://dev.rubyonrails.org/ticket/1246 http://dev.rubyonrails.org/ticket/1260 I''m not sure if it''s been fixed in the edge code, since the bug is several months old and is still open and I''m using 1.0. I also haven''t tried the patches in any of the bugs. I think I ended up using separate month and day pulldowns instead of a date_select(:discard_year => true). Cheers, - stuart
Thanks Stuart. I''ll use seperate pulldowns for now then and look out for when the creases are ironed out. Very much appreciate your help! Doug Stuart Piltch wrote:> Doug <doug.bromley@...> writes: > >> >> Much appreciated. >> >> Doug > > Hi Doug, > > I ran across this recently and found some known bugs: > > http://dev.rubyonrails.org/ticket/1175 > http://dev.rubyonrails.org/ticket/1246 > http://dev.rubyonrails.org/ticket/1260 > > I''m not sure if it''s been fixed in the edge code, since the bug is > several > months old and is still open and I''m using 1.0. I also haven''t tried the > patches > in any of the bugs. I think I ended up using separate month and day > pulldowns > instead of a date_select(:discard_year => true). > > Cheers, > > - stuart-- Posted via http://www.ruby-forum.com/.
On Jan 26, 2006, at 4:17 PM, Doug wrote:> Thanks Stuart. > > I''ll use seperate pulldowns for now then and look out for when the > creases are ironed out. > > Very much appreciate your help! > > Doug >Hi Doug, You might also want to check out the bundled_resource plugin I just announced on the list, as it includes a novel way of entering 12-hour time instead of 24-hour time. While it''s not on the list of most-elegant solutions, it does the job in a simple way: basically, the dynarch_calendar bundle re-opens the DateTime class and allows the 6th parameter (normally seconds) to optionally be an "AM" or "PM" string. If this is the case, it will update the 1st parameter (the hour) to be a 24 hour parameter even though only 12 hours are ever selectable by the user. The dynarch_time_select method can be used independently, and does not require any of the javascripts or stylesheets associated with the dynarch calendar. Duane Johnson (canadaduane) http://blog.inquirylabs.com/