support short as well as long names in date formatting
authorRiver Tarnell <kateturner@users.mediawiki.org>
Mon, 27 Dec 2004 17:50:51 +0000 (17:50 +0000)
committerRiver Tarnell <kateturner@users.mediawiki.org>
Mon, 27 Dec 2004 17:50:51 +0000 (17:50 +0000)
includes/DateFormatter.php

index e2d4c12..d19aa41 100755 (executable)
@@ -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));
        }
 
        /**