Make WordPress Core

Ticket #1200: date_i18n.2.patch

File date_i18n.2.patch, 1.4 KB (added by nbachiyski, 19 years ago)
  • wp-includes/functions.php

     
    5959}
    6060
    6161function date_i18n($dateformatstring, $unixtimestamp) {
    62         global $month, $weekday;
     62        global $month, $weekday, $month_abbrev, $weekday_abbrev;
    6363        $i = $unixtimestamp;
    6464        if ((!empty($month)) && (!empty($weekday))) {
    6565                $datemonth = $month[date('m', $i)];
     66                $datemonth_abbrev = $month_abbrev[$datemonth];
    6667                $dateweekday = $weekday[date('w', $i)];
     68                $dateweekday_abbrev = $weekday_abbrev[$dateweekday];           
    6769                $dateformatstring = ' '.$dateformatstring;
    68                 $dateformatstring = preg_replace("/([^\\\])D/", "\\1".backslashit(substr($dateweekday, 0, 3)), $dateformatstring);
     70                $dateformatstring = preg_replace("/([^\\\])D/", "\\1".backslashit($dateweekday_abbrev), $dateformatstring);
    6971                $dateformatstring = preg_replace("/([^\\\])F/", "\\1".backslashit($datemonth), $dateformatstring);
    7072                $dateformatstring = preg_replace("/([^\\\])l/", "\\1".backslashit($dateweekday), $dateformatstring);
    71                 $dateformatstring = preg_replace("/([^\\\])M/", "\\1".backslashit(substr($datemonth, 0, 3)), $dateformatstring);
     73                $dateformatstring = preg_replace("/([^\\\])M/", "\\1".backslashit($datemonth_abbrev), $dateformatstring);
    7274                $dateformatstring = substr($dateformatstring, 1, strlen($dateformatstring)-1);
    7375        }
    7476        $j = @date($dateformatstring, $i);