[html-formfu] PATCH for timezone support for H::F::Inflator::DateTime

Carl Franks fireartist at gmail.com
Mon Jul 21 10:03:24 BST 2008


2008/7/17 Carl Franks <fireartist at gmail.com>:
> 2008/7/17 Moritz Onken <onken at houseofdesign.de>:
>> Could you implement a default_time_zone config option?
>> This would be really useful beacase you only have to set it once.
>
> Hm, I think we ought to supplement the element_defaults() method with
> some new ones:
>  deflator_defaults()
>  filter_defaults
>  constraint_defaults()
>  transformer_defaults()
>  validator_defaults()
>  inflator_defaults()

I've been mulling this over, and am worried this is a bit too much
"namespace pollution".

I'm considering just adding a defaults() method, which would accept
arguments such as:
    defaults:
      inflators:
        DateTime:
          time_zone: 'Europe/Helsinki'

And deprecating element_defaults() - meaning it'll issue a warning
that it'll be removed in a future release, and it'll just internally
do a hash-merge with defaults->{elements}

Does that sound any better?

Carl



More information about the HTML-FormFu mailing list