Hi,

I'm trying to reformat a date field from a MySQL table - wanting to go 
from yyyy-mm-dd to mm/dd/yyyy when displayed on a webpage. So, following 
some advice I did the following:

package DB::Main::Book;

use base qw/DBIx::Class/;

# Load required DBIC stuff
__PACKAGE__->load_components(qw/PK::Auto Core InflateColumn::DateTime/);
# Set the table name
__PACKAGE__->table('books');
# Set columns in table
__PACKAGE__->add_columns(date => { data_type => 'date' });
__PACKAGE__->add_columns(qw/id book author date/);
# # Set the primary key for the table
__PACKAGE__->set_primary_key('id');

Next in my code(Mason page):
<% $quote->depart_date->mdy() %> depart date<br>

I get the following result:

        Can't call method "mdy" without a package or object reference at


It works fine without the '->mdy()' but of course doesn't format the 
date as wished for.

I followed the doc and I've tried several variations but this looks like 
it should work according to how the doc looks.

Any suggestions?

Justin

_______________________________________________
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]/

Reply via email to