hi Sergey

To extend the year range (using Rails 2.x and Hobo 1.0.x) you should
extend the Date Tag in Application.dryml

for example:

<extend tag="input" for="date">
   <old-input merge include-blank="&true" order="day,month,year" start-
year="&1990"/>
</extend>

in this case my year starts at 1990,
I changed the field order (to day/month/year format) and accept blank
dates .


to correct wrong date validations you should use a Rails plugin (it's
a generic Rails problem) but I didn't use it yet.

best regards,
eddie.


On Mar 9, 12:34 pm, sergio <[email protected]> wrote:
> Hello Hobo users.
>
> Two questions about date[s] in hobo:
>
> - how can I change the default of 5 years which I get to see in views
> having a date ?
> I would like to setup my own range, e.g. Date.today.beginning_of_year
> - 80.years
>
> - how can I best patch the 'invalid date' error for cases where the
> user selects, for example, 31/2 which is invalid.
>
> The problem comes from
>
>         if value.is_a? Hash
>           parts = %w{year month day}.map{|s| value[s].to_i}
>           if parts.include?(0)
>             nil
>           else
>             Date.new(*parts) <<<<<<<<<<<<<<<<<<<<< HERE
>           end
>         else
>           value
>         end
>
> see hobo-1.0.2/lib/hobo/model.rb
>
> Thanks! This stuff is awesome!
>
> Sergey

-- 
You received this message because you are subscribed to the Google Groups "Hobo 
Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/hobousers?hl=en.

Reply via email to