[html-formfu] best practice for a time field?

Alan Hicks ahicks at p-o.co.uk
Fri Aug 31 23:12:21 GMT 2007


Alan Hicks wrote:
> Barry Hoggard wrote:
>> I have some datetime elements in my current project.  I've looked at
>> the HTML::FormFu::Element::Date object for the dates, but can someone
>> point me to the best way to take care of hour/minute/AMPM stuff?
>> Should I use Multi for that?
>>
>>
> =

> I'm currently using a Time class based on the =

> HTML::FormFu::Element::Date object that you are welcome to try.  Alas =

> there are still tests to write.
> =

> It was put together fairly quickly so I'm sure there will be many better =

> and easier ways of doing dates.
> =

> Enjoy,
> Alan
> =


Test are a good thing unlike my flawed coding...

After putting together an Element::Time it generally works ok, though I =

am unable to get a default value for '00' times.

Any pointers would be helpful as well as how to extend validation for =

invalid times other than just not being there.

Even better if Barry's question brings a more elegant solution.

Thanks Alan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Time.pm
Type: application/x-perl
Size: 15980 bytes
Desc: not available
Url : http://lists.scsys.co.uk/pipermail/html-formfu/attachments/20070831/2=
e45c3ba/Time-0001.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: time.t
Type: text/troff
Size: 10629 bytes
Desc: not available
Url : http://lists.scsys.co.uk/pipermail/html-formfu/attachments/20070831/2=
e45c3ba/time-0001.bin


More information about the HTML-FormFu mailing list