# Radrails and date in mysql problem

**URL:** <https://www.ruby-forum.com/t/radrails-and-date-in-mysql-problem/91864>\
**Category:** Rails\
**Created:** [April 12, 2007, 10:23pm UTC](https://www.ruby-forum.com/t/radrails-and-date-in-mysql-problem/91864 "2007-04-12T22:23:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![alexmic](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/977dab/32.png) [@alexmic](https://www.ruby-forum.com/u/alexmic)\
**Post date:** [April 12, 2007, 10:23pm UTC](https://www.ruby-forum.com/t/radrails-and-date-in-mysql-problem/91864/1 "2007-04-12T22:23:55Z")

</div>

Hi,

Im using radrails and mysql database, im using DATE in mysql for a date  
of birth column,

When i use this in Radrails the date shows as dropdown lists, the days  
and month are fine but the year list only shows 2002-2012.

Is there any way of extending the years? as its not suitable for date of  
birth.

Any help appreciated

---

<div class="post-metadata">

**Author:** ![alexmic](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/977dab/32.png) [@alexmic](https://www.ruby-forum.com/u/alexmic)\
**Post date:** [April 13, 2007, 10:23am UTC](https://www.ruby-forum.com/t/radrails-and-date-in-mysql-problem/91864/2 "2007-04-13T10:23:56Z")

</div>

help

---

<div class="post-metadata">

**Author:** ![alexmic](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/977dab/32.png) [@alexmic](https://www.ruby-forum.com/u/alexmic)\
**Post date:** [April 13, 2007, 10:28am UTC](https://www.ruby-forum.com/t/radrails-and-date-in-mysql-problem/91864/3 "2007-04-13T10:28:31Z")

</div>

It would help if you showed us the code you are using to generate the  
drop-down list…

---

<div class="post-metadata">

**Author:** ![alexmic](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/977dab/32.png) [@alexmic](https://www.ruby-forum.com/u/alexmic)\
**Post date:** [April 13, 2007, 10:58am UTC](https://www.ruby-forum.com/t/radrails-and-date-in-mysql-problem/91864/4 "2007-04-13T10:58:40Z")

</div>

> Im using radrails and mysql database, im using DATE in mysql for a date of birth column, When i use this in Radrails the date shows as dropdown lists, the days and month are fine but the year list only shows 2002-2012.

i was a bit misleaded because of the mysql bit, but after reading your  
mail twice i’d say the db has nothing to do with this problem and your  
problem is about date\_select

under this assumption, i would recommend to read through the date\_select  
documentation, specially where it says " It’s possible to tailor the  
selects through the options hash, which accepts all the keys that each  
of the individual select builders do (like :use\_month\_numbers for  
select\_month  
[http://api.rubyonrails.com/classes/ActionView/Helpers/DateHelper.html#M000587](http://api.rubyonrails.com/classes/ActionView/Helpers/DateHelper.html#M000587))  
as well as a range of discard options"

then if you go to the “select\_year” doc you will see a couple of  
interesting options: :start\_year and :end\_year.

so… if you provide date\_select with these two options, you can  
constraint the date range to use instead of going with the default  
(which is 5 years before/after the given date).

For future questions to the list i’d recommend to post the code where  
you have the problem, that way no assumptions about what you are doing  
are needed 😉

regards,

javier ramirez

## –

Estamos de estreno… si necesitas llevar el control de tus gastos  
visita [http://www.gastosgem.com](http://www.gastosgem.com) !!Es gratis!!
