# Discard\_year =\> true

**URL:** <https://www.ruby-forum.com/t/discard-year-true/97807>\
**Category:** Rails\
**Created:** [January 26, 2006, 10:10pm UTC](https://www.ruby-forum.com/t/discard-year-true/97807 "2006-01-26T22:10:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![doug](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/dbc845/32.png) [@doug](https://www.ruby-forum.com/u/doug)\
**Post date:** [January 26, 2006, 10:10pm UTC](https://www.ruby-forum.com/t/discard-year-true/97807/1 "2006-01-26T22:10:13Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![doug](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/dbc845/32.png) [@doug](https://www.ruby-forum.com/u/doug)\
**Post date:** [January 27, 2006, 12:12am UTC](https://www.ruby-forum.com/t/discard-year-true/97807/2 "2006-01-27T00:12:25Z")

</div>

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/1175)  
[http://dev.rubyonrails.org/ticket/1246](http://dev.rubyonrails.org/ticket/1246)  
[http://dev.rubyonrails.org/ticket/1260](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

---

<div class="post-metadata">

**Author:** ![doug](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/dbc845/32.png) [@doug](https://www.ruby-forum.com/u/doug)\
**Post date:** [January 27, 2006, 5:19am UTC](https://www.ruby-forum.com/t/discard-year-true/97807/3 "2006-01-27T05:19:43Z")

</div>

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 J.  
(canadaduane)  
[http://blog.inquirylabs.com/](http://blog.inquirylabs.com/)

---

<div class="post-metadata">

**Author:** ![doug](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/dbc845/32.png) [@doug](https://www.ruby-forum.com/u/doug)\
**Post date:** [January 27, 2006, 12:17am UTC](https://www.ruby-forum.com/t/discard-year-true/97807/4 "2006-01-27T00:17:16Z")

</div>

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/1175)  
> [http://dev.rubyonrails.org/ticket/1246](http://dev.rubyonrails.org/ticket/1246)  
> [http://dev.rubyonrails.org/ticket/1260](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
