From 7b843c99b7420bc9ebb421b13ebae85cdfc73797 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Niklas=20Laxstr=C3=B6m?= Date: Tue, 10 Jan 2006 12:22:58 +0000 Subject: [PATCH] Moved wgAmericanDate check to date() from dateFormat() where it broke default time preference for other languages --- RELEASE-NOTES | 2 ++ languages/Language.php | 9 +++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 610a6bc41c..e41d96170f 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -198,6 +198,8 @@ i18n / Languages: - Removed hardcoded namespaces: Tt, Ms, Ia, Ga, Fo, Bn, Csb, He, Nv, Oc, Tlh - Removed some useless backwards compatibility hacks - Fixed formatnum on many languages +* wgAmericanDates check produced incorrect results in languages that don't have + a such distinction Parser: * (bug 2522) {{CURRENTDAY2}} now shows the current day number with two digits diff --git a/languages/Language.php b/languages/Language.php index 765c6f3664..644dcdd1c2 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -2469,9 +2469,11 @@ class Language { $datePreference = (string)$usePrefs; } - if( $datePreference == MW_DATE_DEFAULT || $datePreference == '' ) { - return $wgAmericanDates ? MW_DATE_MDY : MW_DATE_DMY; + // return int + if( $datePreference == '' ) { + return MW_DATE_DEFAULT; } + return $datePreference; } @@ -2492,6 +2494,9 @@ class Language { if ( $adj ) { $ts = $this->userAdjust( $ts, $timecorrection ); } $datePreference = $this->dateFormat( $format ); + if( $datePreference == MW_DATE_DEFAULT ) { + return $wgAmericanDates ? MW_DATE_MDY : MW_DATE_DMY; + } $month = $this->formatMonth( substr( $ts, 4, 2 ), $datePreference ); $day = $this->formatDay( substr( $ts, 6, 2 ), $datePreference ); -- 2.20.1