#63352 by kkaefer: add special prefix to long month names in format_date so May is recognized differently in short and long formats

6.x
Gábor Hojtsy 2007-09-12 13:30:42 +00:00
parent ffa1f6ef69
commit b3fe5b9cbf
1 changed files with 7 additions and 1 deletions

View File

@ -1139,9 +1139,15 @@ function format_date($timestamp, $type = 'medium', $format = '', $timezone = NUL
$date = '';
for ($i = 0; $i < $max; $i++) {
$c = $format[$i];
if (strpos('AaDFlM', $c) !== FALSE) {
if (strpos('AaDlM', $c) !== FALSE) {
$date .= t(gmdate($c, $timestamp), array(), $langcode);
}
else if ($c == 'F') {
// Special treatment for long month names: May is both an abbreviation
// and a full month name in English, but other languages have
// different abbreviations.
$date .= trim(t('!long-month-name '. gmdate($c, $timestamp), array('!long-month-name' => ''), $langcode));
}
else if (strpos('BdgGhHiIjLmnsStTUwWYyz', $c) !== FALSE) {
$date .= gmdate($c, $timestamp);
}