FIXED: Formatters in v1.0 not working as expected
Building a news module using FUEL 1.0 and I'm not seeing the Model Formatter functions behave in the manner I would expect.
My DB table has field
`date_added` date NOT NULL default '0000-00-00',
in application/config/MY_config.php
// date format used with date helpers
$config['date_format'] = 'm/d/Y';
$config['date_format_verbose'] = 'F j, Y';
$config['time_format'] = 'g:ia';
In my view:
// get the article requested
$article = fuel_model('articles',
array('find' => 'one',
'where' => array('slug' => $slug)
)
);
echo $article->date_added_formatted;
this outputs: 2012-11-06 when I expect to get 11/06/2012
Also, when trying to debug this I had log messages in fuel/modules/fuel/helpers/MY_date_helper.php in the date_formatter() function. These never appear in the logs, so I suspect the call chain is borked somewhere along the line.
I am having a similar issue with the {string_field}_formatted functions, which are not outputting the string wrapped in
tags as is documented.
Comments
I'll pull in the latest commit, the branch merge SHA: 4078f2e089a9fe1 and test again.
Thank you for your attention to this.
Topic Headline modified to indicate this was solved.
Thanks!