[Catalyst] How to use HTML::Widget::Constraint::Date

Alejandro Imass alejandro.imass at gmail.com
Sun Nov 26 18:40:55 GMT 2006


Thanks!

But how do I use this constraint if I have several date fields in my
form? Suppose I have two dates which would mean 6 fields on the form
(per your explanation above). Do I just pass all 6 in order to the
constraint? or am I missing the point entirely?

On 11/26/06, Michele Beltrame <mb at italpro.net> wrote:
> Hello!
>
> > my $c = $widget->constraint( 'Date', 'year', 'month', 'day' );
> >
>
> This constraint requirtes you to have three fields: one with day, one
> with month, one with years. This a common thing, as in many cases there
> are three select boxes which allow the user to select a date.
>
> Others (including me) use a single text field maybe with some help such
> as JSCalendar. In this case you might be better off defining a filter
> which creates a DateTime and then work with that. This is also handy if
> you need to store the data in a database, as you can define an inflater
> for DateTime objects.
>
> Michele.
>
> --
> Michele Beltrame
> http://www.varlogarthas.net/
> ICQ# 76660101
> Informativa privacy: http://www.italpro.net/em.html
>
> _______________________________________________
> List: Catalyst at lists.rawmode.org
> Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
> Dev site: http://dev.catalyst.perl.org/
>



More information about the Catalyst mailing list