From: River Tarnell Date: Mon, 27 Dec 2004 17:50:51 +0000 (+0000) Subject: support short as well as long names in date formatting X-Git-Tag: 1.5.0alpha1~1025 X-Git-Url: http://git.cyclocoop.org/%24action?a=commitdiff_plain;h=6c4c8ab3c6adde838cde6074c6ce285dd225ff99;p=lhc%2Fweb%2Fwiklou.git support short as well as long names in date formatting --- diff --git a/includes/DateFormatter.php b/includes/DateFormatter.php index e2d4c124dd..d19aa4102d 100755 --- a/includes/DateFormatter.php +++ b/includes/DateFormatter.php @@ -47,12 +47,15 @@ class DateFormatter * @todo document */ function DateFormatter() { - global $wgMonthNamesEn, $wgInputEncoding; + global $wgMonthNamesEn, $wgMonthAbbreviationsEn, $wgInputEncoding; $this->monthNames = $this->getMonthRegex(); for ( $i=1; $i<=12; $i++ ) { $this->xMonths[strtolower( $wgMonthNamesEn[$i-1] )] = $i; } + for ( $i=1; $i<=12; $i++ ) { + $this->xMonths[strtolower( $wgMonthAbbreviationsEn[$i-1] )] = $i; + } # Attempt at UTF-8 support, untested at the moment if ( $wgInputEncoding == 'UTF-8' ) { @@ -222,8 +225,8 @@ class DateFormatter * @todo document */ function getMonthRegex() { - global $wgMonthNamesEn; - return implode( '|', $wgMonthNamesEn ); + global $wgMonthNamesEn, $wgMonthAbbreviationsEn; + return implode( '|', array_merge($wgMonthNamesEn, $wgMonthAbbreviationsEn)); } /**