rails nut writes:
> Has anyone ever tweaked the standard date controls to ban dates like
> 30th february ?
>
> As standard, if you enter 30th february , it goes through quietly (no
> errors) as 2nd march.
Tom Mornini <tmornini@...> writes:
>
> I just use the standard library's date validation
> within the model's validate method.
>
If Rails automatically converts a 'bad' date into it's equivalent 'good'
date, wouldn't the model's validation method always see a valid date? At what
point in the object's life cycle does 'Feb 30' or 'June 31' get translated
into 'March 2' and 'July 1'?
>From the descriptions, it seems that rails nut's app is happily chugging
along
when weird dates are entered, while Tom's models raise a validation error. I'm
assuming, of course, that if rails nut added date validation to the method, it
would also barf on a weird date, meaning that validation is the way to handle
this issue. However, if the bad dates go through even with validation, then
that is something different...
...Isn't it? I'm a n00b t00, so this is more of a "verifiying my
knowledge"
than a "this is the answer."