Validation date

Hi everybody !
I can’t find validation for date.
In my form I use form.date_select.
How I can protect this field from selection for egzample “month->
February, day -> 30”.
ActiveRecord don’t save it, but error will raise. I would like to serve
this error in this same way as other kind of validation.
Similar problem is when we have
form.date_select :date_attribute, {:include_blank => true}.
Then strange date save possibly, when not all three parts was selected,
for egzample only month but not year and day. Always first part is as
year and missing data are filled with 1.
How I can via validation indicate my user which part of date he/she has
forgetten fill.
Theoretically we have validates_format_of with option :with, but I
couldn’t find it as useful in this case. Maybe I’m wrong.
What kind of strategy I should choice?

I use the calendar control from http://datetime.toolbocks.com/. It
takes care of preventing invalid dates such as February 30th.

On May 22, 7:44 pm, Walde M. [email protected]

If you check the TRUNK, you’ll notice it will solve any RJS problems
you may have had with older versions causing errors. Also couple fixes
in there for Modal windows so it shows up on top.

Official release coming soon! :slight_smile:

Nathaniel.

On 5/22/07, Myron M. [email protected] wrote:

How I can protect this field from selection for egzample "month->
Theoretically we have validates_format_of with option :with, but I
couldn’t find it as useful in this case. Maybe I’m wrong.
What kind of strategy I should choice?


Posted viahttp://www.ruby-forum.com/.


Nathaniel Steven Henry Brown

Toll Free: 1-877-446-4647
Vancouver: 604-724-6624