Forum: Ruby on Rails using select_date causes errors...

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Randal S. (Guest)
on 2006-05-03 05:30
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,
Randal S. (Guest)
on 2006-05-03 17:58
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,
Randal S. (Guest)
on 2006-05-03 18:15
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
Jean-François (Guest)
on 2006-05-03 21:06
(Received via mailing list)
2006/5/3, Randal S. <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.
This topic is locked and can not be replied to.