[html-formfu] Re: Date Element

Carl Franks fireartist at gmail.com
Mon Aug 6 15:26:02 GMT 2007


On 06/08/07, Tobias Kremer <list at funkreich.de> wrote:

> 2.) By default there shouldn't be a valid date selected. The three select

Some applications may wish to always set the default date itself - and
not have an empty item at the start of each menu - thereby forcing the
selection of a value.

> fields need some default entries like "Day", "Month", "Year". Of course, it
> should be possible to localize these somewhere without having to specify them
> for every Date element. Unfortunately DateTime::Locale doesn't have
> translations for these.

There are 3 new methods day_prefix(), month_prefix and year_prefix().

These accept either a single value or an arrayref of values that are
added to the start of the appropriate menu.
The param value for each of these prefixes is always the empty string.

How about having a day_prefix_loc() which would do the equivalent of:

    sub day_prefix_loc {
        my ($self, $key) = @_;
        $self->day_prefix( $self->form->loc( $key ) );
        return $self;
    }

... and similar for months/years?

Carl



More information about the HTML-FormFu mailing list