European date format in ROSE HMTL?

19 views
Skip to first unread message

jfrm

unread,
Jul 28, 2012, 4:55:59 AM7/28/12
to rose-htm...@googlegroups.com
Hopefully an easy one but I've read through  Rose::HTML::Form::Field::DateTime and Rose::DateTime::Parser and cannot see how to make my Rose:HTML field work with european formatted dates. In my form package
$self->add_fields(
.... s_dateafter => {type => 'date', rank => 21, label => 'Date After'},...

If I put in date 12/24/2012, the validation fails which I understand.  Adding a parse_date parameter doesn't work. 
s_dateafter => {type => 'date', 'parse_date' => 'european', rank => 21, label => 'Last Order Date After'},

Any assistance, much appreciated.  8o)

John Siracusa

unread,
Jul 28, 2012, 10:02:14 AM7/28/12
to rose-htm...@googlegroups.com
I'm not sure if there's a clean way to do this (though patches to
create one would be welcome). A very ugly way to do it is to set
$Rose::DateTime::Util::European_Dates = 1 somewhere in your code,
which will make all Rose date parsing accept the European format.
I'll look into a cleaner solution when I get a chance (unless someone
beats me to it).

-John

jfrm

unread,
Jul 28, 2012, 6:53:03 PM7/28/12
to rose-htm...@googlegroups.com
> A very ugly way to do it is to set

Beauty is in the eye of the beholder. Looks gorgeous to me. Many thanks.
 
Reply all
Reply to author
Forward
0 new messages