Forum: Ruby on Rails discard_year => true

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
32ba8c5c148da2653028dc7f8066b810?d=identicon&s=25 Doug (Guest)
on 2006-01-26 22:10
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
C9c272c33c66abeb2ec9295300615ed9?d=identicon&s=25 Stuart Piltch (Guest)
on 2006-01-27 00:12
(Received via mailing list)
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
32ba8c5c148da2653028dc7f8066b810?d=identicon&s=25 Doug (Guest)
on 2006-01-27 00:17
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
D8cb8c8cd40ddf0cd05241443a591868?d=identicon&s=25 Duane Johnson (Guest)
on 2006-01-27 05:19
(Received via mailing list)
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/
This topic is locked and can not be replied to.