On May 10, 2007, at 8:17 AM, RA Jones wrote:
__PACKAGE__->load_components(qw/PK::Auto Core
InflateColumn::DateTime/);
I think InflateColumn::DateTime probably has to be _before_ Core:
__PACKAGE__->load_components(qw/InflateColumn::DateTime Core/);
Note also that PK::Auto is included in 'Core', so you don't have to
specify it.
On reflection though, maybe InflateColumn is not the correct method
for what I really want - to globally reformat date fields to EU
format.
If you're certain you'll only want an EU formatted date, you can use
DBIx::Class::InflateColumn in your resultset and add the code to
inflate to whatever you'd like. Check the InflateColumn docs for an
example.
I generally prefer receiving the DateTime object, though, since my
formatting is usually dependent on what I'm doing with the data. If
you're using something like Catalyst, I'd pass the DateTime object
down to the view, and let it decide how to format it.
-A
_______________________________________________
List: http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class
Wiki: http://dbix-class.shadowcatsystems.co.uk/
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/
Searchable Archive: http://www.mail-archive.com/[email protected]/