[html-formfu] Date + Time Select boxes?

Carl Franks fireartist at gmail.com
Wed Nov 26 14:55:42 GMT 2008


2008/11/26 Jens Schwarz <blacky6767 at gmx.de>:
> Hi *,
>
> I know the 'Date' element of FormFu which works fine. But now I need an element where I can also select time in the same manner (my mySQL db has a 'datetime' column).
>
> Putting a 'Date' and two 'Select' elements (i.e. hour and minute) into a 'Multi' element does not seem to work (I have read this somewhere in the depths of this malinglist and also tried it by my own hand) - mainly because of the 'Date' element being a 'Multi' element itself.
>
> So my question: How do you implement such a 'DateTime' element so that it runs smoothly with Catalyst and DBIx?

I've added a DateTime element to svn.
It's a sub-class of HTML/FormFu/Element/Date.pm and adds extra 'hour'
and 'minute' Select menus.

The tests cover passing a DateTime object to $field->default() and
outputting a DateTime object by setting $field->auto_inflate(1) - so
that should cover integration with
DBIx::Class::InflateColumn::DateTime.

You will need to be running HTML-FormFu from svn for it to work - it
needs changes to the Date element which were made since the last cpan
release.

I plan to add an option to limit the minute menu, so for example, it
will only list every 5 minutes (00,05,10,etc) - but haven't gotten
around to that yet.

Carl



More information about the HTML-FormFu mailing list