# Only years from 2001 to 2011 are available in a date field

**URL:** <https://www.ruby-forum.com/t/only-years-from-2001-to-2011-are-available-in-a-date-field/61504>\
**Category:** Rails\
**Created:** [May 24, 2006, 5:19pm UTC](https://www.ruby-forum.com/t/only-years-from-2001-to-2011-are-available-in-a-date-field/61504 "2006-05-24T17:19:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![fabvit](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/6a8cbe/32.png) [@fabvit](https://www.ruby-forum.com/u/fabvit)\
**Post date:** [May 24, 2006, 5:19pm UTC](https://www.ruby-forum.com/t/only-years-from-2001-to-2011-are-available-in-a-date-field/61504/1 "2006-05-24T17:19:03Z")

</div>

When I try to edit a date field in the drop down list I have only years  
from 2001 to 2011: how can I add an arbitrary year that is NOT included  
in this list?

---

<div class="post-metadata">

**Author:** ![fabvit](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/6a8cbe/32.png) [@fabvit](https://www.ruby-forum.com/u/fabvit)\
**Post date:** [May 24, 2006, 5:25pm UTC](https://www.ruby-forum.com/t/only-years-from-2001-to-2011-are-available-in-a-date-field/61504/2 "2006-05-24T17:25:23Z")

</div>

The default is to have 5 years before and after the current year. there  
is a way you can extend it. try reading chapter 17 in the agile web  
development book.

---

<div class="post-metadata">

**Author:** ![fabvit](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/6a8cbe/32.png) [@fabvit](https://www.ruby-forum.com/u/fabvit)\
**Post date:** [May 24, 2006, 5:42pm UTC](https://www.ruby-forum.com/t/only-years-from-2001-to-2011-are-available-in-a-date-field/61504/3 "2006-05-24T17:42:03Z")

</div>

On 5/24/06, fabio vitale [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> When I try to edit a date field in the drop down list I have only years  
> from 2001 to 2011: how can I add an arbitrary year that is NOT included  
> in this list?

> **[ActionView::Helpers::DateHelper](https://api.rubyonrails.org/classes/ActionView/Helpers/DateHelper.html#M000479)**
>
> Action View Date Helpers The Date Helper primarily creates select/option tags for different kinds of dates and times or date and time elements.

Look at the options for select\_year, specifically :start\_year and  
:end\_year. select\_date will accept these as well.

– James
