From b3fe5b9cbff70dd29a574e6770f32bcb48c6a78c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Hojtsy?= Date: Wed, 12 Sep 2007 13:30:42 +0000 Subject: #63352 by kkaefer: add special prefix to long month names in format_date so May is recognized differently in short and long formats --- includes/common.inc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/includes/common.inc b/includes/common.inc index b0cd37a9f..6aeb02032 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -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); } -- cgit v1.2.3