Last active
December 2, 2019 13:15
-
-
Save OlegShchavelev/9f21a018f18071b0629e2eb9edad00f7 to your computer and use it in GitHub Desktop.
Выводим дату на Modx с русским названием месяца
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{$publishedon | date : "d M Y" | rus_months} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$months = array( | |
'Jan' => 'января', | |
'Feb' => 'февраля', | |
'Mar' => 'марта', | |
'Apr' => 'апреля', | |
'May' => 'мая', | |
'Jun' => 'июня', | |
'Jul' => 'июля', | |
'Aug' => 'августа', | |
'Sep' => 'сентября', | |
'Oct' => 'октября', | |
'Nov' => 'ноября', | |
'Dec' => 'декабря', | |
); | |
return str_replace(array_keys($months), array_values($months), $input); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment