From 6c4c8ab3c6adde838cde6074c6ce285dd225ff99 Mon Sep 17 00:00:00 2001 From: River Tarnell Date: Mon, 27 Dec 2004 17:50:51 +0000 Subject: [PATCH] support short as well as long names in date formatting --- includes/DateFormatter.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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)); } /** -- 2.20.1