[Catalyst] setting the locale with DBIx::Class::InflateColumn::DateTime

Octavian Rasnita orasnita at gmail.com
Fri Apr 24 08:53:33 GMT 2009


Hi,

(Sorry for asking on this list, but my messages are rejected from DBIC 
mailing list.)

Is it possible to set the locale for a certain date field if 
DBIx::Class::InflateColumn::DateTime is used when using that date, and not 
in the class definition?

I don't think it is OK to hard code the locale for a certain column in the 
class definition, because the data from that column might be presented in 
different languages, for different locales.

In the POD documentation of DBIx::Class::InflateColumn::DateTime I've 
learned how to set the locale for the date columns, but only by setting it 
in the class definition.

I've tried to set it when I used it, like

$class->date_field->month_name(locale => 'ro_RO')
or
$class->date_field->month_name({locale => 'ro_RO'})

with no luck, of course.

Thank you for any hints.

--
Octavian




More information about the Catalyst mailing list