How to use an array for the plugin Page_params and Yanp?
Code: Select all
$month_names = array('Декабрь', 'Январь', 'Февраль', 'Март', 'Апрель', 'Май', 'Июнь', 'Июль', 'Август', 'Сентябрь', 'Октябрь', 'Ноябрь' );
Code: Select all
$month_names = array('Декабрь', 'Январь', 'Февраль', 'Март', 'Апрель', 'Май', 'Июнь', 'Июль', 'Август', 'Сентябрь', 'Октябрь', 'Ноябрь' );
Good point! I think it's time to think about a general solution for localized month names (and date representations in general).Termin wrote:How to use an array for the plugin Page_params and Yanp?
Code: Select all
return strftime($tx['lastupdate']['dateformat'], $timestamp);
Code: Select all
.'<p><em>'.XH_formatDate(yanp_timestamp($pd)).'</em></p>'."\n"
Well, then you can try the following:Termin wrote:Not one method is not working.
Code: Select all
function XH_formatDate($timestamp)
{
global $tx;
$month_names = array('Декабрь', 'Январь', 'Февраль', 'Март', 'Апрель', 'Май', 'Июнь', 'Июль', 'Август', 'Сентябрь', 'Октябрь', 'Ноябрь' );
$month_name = $month_names[date('n', $timestamp)];
return sprintf(date($tx['lastupdate']['dateformat'], $timestamp), $month_name);
}
Code: Select all
$tx['lastupdate']['dateformat']="d %\\s Y, H:i";