Forum: Ruby on Rails date_select broken

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.
F15fdc7cb2e911b3808837f2be244add?d=identicon&s=25 Adam Denenberg (Guest)
on 2006-01-19 19:58
(Received via mailing list)
I am using date_select and in some instances it only shows about 10
years worth of choices.  Same form on other users shows the whole
range.  date_select looks like this

  <%= date_select 'user','birthdate' , :start_year => 1940 %>

 I would expect to always see 1940-2006 or so , but i dont always do.
Is there a way to force the range or explain why i woudlnt always see
this range ?

thanks
adam
3fdda7e032a5619199486d05b506ced4?d=identicon&s=25 Brad Daily (bdaily)
on 2006-01-19 22:18
Adam Denenberg wrote:
> I am using date_select and in some instances it only shows about 10
> years worth of choices.  Same form on other users shows the whole
> range.  date_select looks like this
>
>   <%= date_select 'user','birthdate' , :start_year => 1940 %>
>
>  I would expect to always see 1940-2006 or so , but i dont always do.
> Is there a way to force the range or explain why i woudlnt always see
> this range ?

Was working with this yesterday, and here is how I did it:

<%= date_select 'user','birthdate' , :start_year => 1940, :end_year =>
Time.now.year %>

You could always do some sort of calculation on that, as I am assuming
you don't have 1 or 2 year olds using your site :)
F15fdc7cb2e911b3808837f2be244add?d=identicon&s=25 Adam Denenberg (Guest)
on 2006-01-19 22:35
(Received via mailing list)
thanks i will try that. Is this a known bug of some sort ?
This topic is locked and can not be replied to.