# Issues with date\_select

**URL:** <https://www.ruby-forum.com/t/issues-with-date-select/137737>\
**Category:** Rails\
**Created:** [May 15, 2008, 9:10pm UTC](https://www.ruby-forum.com/t/issues-with-date-select/137737 "2008-05-15T21:10:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sgudibanda](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/a9adbd/32.png) [@sgudibanda](https://www.ruby-forum.com/u/sgudibanda)\
**Post date:** [May 15, 2008, 9:10pm UTC](https://www.ruby-forum.com/t/issues-with-date-select/137737/1 "2008-05-15T21:10:53Z")

</div>

Hi,

I have an application where in I ask for DOB(date of birth) from users  
and i am using date\_select (discarding hour):

1. If someone doesn’t enter day and month but enters YEAR(say 1980) in  
DOB - Its gets stored as 1st of Jan of that year (DOB will be 1-1-1980)

2. More funny - if some one doesn’t enter YEAR but enters day and month  
(say 10 of March) - It takes 2001 as default year. so DOB will be  
10-03-2001

Can we not enter only value of year (1980 only) or only month and year  
into datetime field? Is the only solution is to have separate field for  
these?

Also, I have questions like, when did you join this school: Again i used  
date\_select(discarding days): Everything alright as long as user enters  
both month and year. But if somone only wishes to enter year (valid use  
case), it takes Jan as default month. How do i avoid such cases?

Any thoughts?

Regards,  
Sandeep G
