# Using select\_date causes errors

**URL:** <https://www.ruby-forum.com/t/using-select-date-causes-errors/94374>\
**Category:** Rails\
**Created:** [May 3, 2006, 3:30am UTC](https://www.ruby-forum.com/t/using-select-date-causes-errors/94374 "2006-05-03T03:30:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Randal\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/b487fb/32.png) [@Randal\_S](https://www.ruby-forum.com/u/Randal_S)\
**Post date:** [May 3, 2006, 3:30am UTC](https://www.ruby-forum.com/t/using-select-date-causes-errors/94374/1 "2006-05-03T03:30:58Z")

</div>

I’m getting errors whenever the user chooses, for example, April 31st (  
since there is no 31st in April, navicat freaks out ), there MUST be a  
method that ruby has that would allow me to validate a date before I  
submit to navicat.

I haven’t been able to find anything online about it either, it’s  
probably something simple, I just can’t figure it out.

Thanks in advance,

---

<div class="post-metadata">

**Author:** ![Randal\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/b487fb/32.png) [@Randal\_S](https://www.ruby-forum.com/u/Randal_S)\
**Post date:** [May 3, 2006, 3:58pm UTC](https://www.ruby-forum.com/t/using-select-date-causes-errors/94374/2 "2006-05-03T15:58:01Z")

</div>

This HAS to be a common problem. No one else suffering from it?

Randal S. wrote:

> I’m getting errors whenever the user chooses, for example, April 31st (  
> since there is no 31st in April, navicat freaks out ), there MUST be a  
> method that ruby has that would allow me to validate a date before I  
> submit to navicat.
> 
> I haven’t been able to find anything online about it either, it’s  
> probably something simple, I just can’t figure it out.
> 
> Thanks in advance,

---

<div class="post-metadata">

**Author:** ![Randal\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/b487fb/32.png) [@Randal\_S](https://www.ruby-forum.com/u/Randal_S)\
**Post date:** [May 3, 2006, 4:15pm UTC](https://www.ruby-forum.com/t/using-select-date-causes-errors/94374/3 "2006-05-03T16:15:17Z")

</div>

Ok, obviously I’m way over-tired…

I’ll just make an if statment to check if the month is one that has 30  
days, and if the day is 31…

… and I’m gonna get some sleep

---

<div class="post-metadata">

**Author:** ![Randal\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/b487fb/32.png) [@Randal\_S](https://www.ruby-forum.com/u/Randal_S)\
**Post date:** [May 3, 2006, 7:06pm UTC](https://www.ruby-forum.com/t/using-select-date-causes-errors/94374/4 "2006-05-03T19:06:17Z")

</div>

2006/5/3, Randal S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> I’m getting errors whenever the user chooses, for example, April 31st (  
> since there is no 31st in April, navicat freaks out ), there MUST be a  
> method that ruby has that would allow me to validate a date before I  
> submit to navicat.
> 
> I haven’t been able to find anything online about it either, it’s  
> probably something simple, I just can’t figure it out.

There’s a plugin “Validates date time” by J. Viney.

Google (or the RoR wiki) is your friend.

– Jean-FranÃ§ois.
