Page MenuHomePhabricator
Authored By
bzimport
Nov 21 2014, 9:01 PM
Size
2 KB
Referenced Files
None
Subscribers
None

diff.txt

--- wiki/includes/DateFormatter.php 2008-09-03 10:28:06.818826600 -0700
+++ wiki2/includes/DateFormatter.php 2008-09-10 16:10:47.291750400 -0700
@@ -11,7 +11,7 @@
var $monthNames = '', $rxDM, $rxMD, $rxDMY, $rxYDM, $rxMDY, $rxYMD;
var $regexes, $pDays, $pMonths, $pYears;
- var $rules, $xMonths, $preferences;
+ var $xMonths, $preferences;
const ALL = -1;
const NONE = 0;
@@ -69,22 +69,15 @@
$this->keys[self::ISO2] = 'ymd';
# Target date formats
- $this->targets[self::DMY] = '[[F j|j F]] [[Y]]';
- $this->targets[self::YDM] = '[[Y]], [[F j|j F]]';
- $this->targets[self::MDY] = '[[F j]], [[Y]]';
- $this->targets[self::YMD] = '[[Y]] [[F j]]';
- $this->targets[self::DM] = '[[F j|j F]]';
- $this->targets[self::MD] = '[[F j]]';
- $this->targets[self::ISO1] = '[[Y|y]]-[[F j|m-d]]';
- $this->targets[self::ISO2] = '[[y-m-d]]';
-
- # Rules
- # pref source target
- $this->rules[self::DMY][self::MD] = self::DM;
- $this->rules[self::ALL][self::MD] = self::MD;
- $this->rules[self::MDY][self::DM] = self::MD;
- $this->rules[self::ALL][self::DM] = self::DM;
- $this->rules[self::NONE][self::ISO2] = self::ISO1;
+ $this->targets[self::DMY] = 'j F Y';
+ $this->targets[self::YDM] = 'Y, j F';
+ $this->targets[self::MDY] = 'F j, Y';
+ $this->targets[self::YMD] = 'Y F j';
+ $this->targets[self::DM] = 'j F';
+ $this->targets[self::MD] = 'F j';
+ $this->targets[self::ISO1] = 'y-m-d';
+ $this->targets[self::ISO2] = 'y-m-d';
+
$this->preferences = array(
'default' => self::NONE,
@@ -123,19 +116,7 @@
}
for ( $i=1; $i<=self::LAST; $i++ ) {
$this->mSource = $i;
- if ( isset ( $this->rules[$preference][$i] ) ) {
- # Specific rules
- $this->mTarget = $this->rules[$preference][$i];
- } elseif ( isset ( $this->rules[self::ALL][$i] ) ) {
- # General rules
- $this->mTarget = $this->rules[self::ALL][$i];
- } elseif ( $preference ) {
- # User preference
- $this->mTarget = $preference;
- } else {
- # Default
- $this->mTarget = $i;
- }
+ $this->mTarget = $i;
$text = preg_replace_callback( $this->regexes[$i], array( &$this, 'replace' ), $text );
}
return $text;

File Metadata

Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2149
Default Alt Text
diff.txt (2 KB)

Event Timeline