Hi, could you please help a newbie with enabling CDateFormatter component in an yii app?
I added this to my protected/config/main.php:
// application components 'components'=>array( ... 'dateFormatter'=>array( 'class' => 'CDateFormatter', 'params' => array('en'), ), ... ),
I would like to use currently selected language and not en, but it doesn’t work like this anyway. Yii throws error “Missing argument 1 for CDateFormatter::__construct()…”. So how do I correctly add CLocale instance as the $locale parameter?
Also, should I use dateFormatter in controller or in view, what is the best practice?