#63352 by kkaefer: add special prefix to long month names in format_date so May is recognized differently in short and long formats
parent
ffa1f6ef69
commit
b3fe5b9cbf
|
@ -1139,9 +1139,15 @@ function format_date($timestamp, $type = 'medium', $format = '', $timezone = NUL
|
||||||
$date = '';
|
$date = '';
|
||||||
for ($i = 0; $i < $max; $i++) {
|
for ($i = 0; $i < $max; $i++) {
|
||||||
$c = $format[$i];
|
$c = $format[$i];
|
||||||
if (strpos('AaDFlM', $c) !== FALSE) {
|
if (strpos('AaDlM', $c) !== FALSE) {
|
||||||
$date .= t(gmdate($c, $timestamp), array(), $langcode);
|
$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) {
|
else if (strpos('BdgGhHiIjLmnsStTUwWYyz', $c) !== FALSE) {
|
||||||
$date .= gmdate($c, $timestamp);
|
$date .= gmdate($c, $timestamp);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue