MediaWiki  REL1_19
DateFormatter Class Reference

Date formatter, recognises dates in plain text and formats them accoding to user preferences. More...

List of all members.

Public Member Functions

 __construct ()
 formatDate ($bits, $link=true)
 getMonthRegex ()
 makeIsoMonth ($monthName)
 Makes an ISO month, e.g.
 makeIsoYear ($year)
 makeNormalYear ($iso)
 reformat ($preference, $text, $options=array('linked'))
 replace ($matches)

Static Public Member Functions

static & getInstance ()
 Get a DateFormatter object.

Public Attributes

 $monthNames = ''
 $mSource
 $mTarget
 $pDays
 $pMonths
 $preferences
 $pYears
 $regexes
 $rules
 $rxDM
 $rxDMY
 $rxMD
 $rxMDY
 $rxYDM
 $rxYMD
 $xMonths
const ALL = -1
const DM = 7
const DMY = 2
const ISO1 = 4
const ISO2 = 5
const LAST = 8
const LASTPREF = 4
const MD = 8
const MDY = 1
const NONE = 0
const YDM = 6
const YMD = 3

Detailed Description

Date formatter, recognises dates in plain text and formats them accoding to user preferences.

Todo:
preferences, OutputPage

Definition at line 13 of file DateFormatter.php.


Constructor & Destructor Documentation

Todo:
document

Definition at line 37 of file DateFormatter.php.

References $wgContLang, ALL, DM, DMY, getMonthRegex(), ISO1, ISO2, MD, MDY, NONE, YDM, and YMD.

Here is the call graph for this function:


Member Function Documentation

DateFormatter::formatDate ( bits,
link = true 
)

Definition at line 193 of file DateFormatter.php.

References $matches, $wgContLang, makeIsoMonth(), makeIsoYear(), makeNormalYear(), and Html\rawElement().

Referenced by replace().

Here is the call graph for this function:

Here is the caller graph for this function:

static& DateFormatter::getInstance ( ) [static]

Get a DateFormatter object.

Returns:
DateFormatter object

Definition at line 108 of file DateFormatter.php.

References $wgMemc, and wfMemcKey().

Referenced by CoreParserFunctions\formatDate(), and Parser\internalParse().

Here is the call graph for this function:

Here is the caller graph for this function:

Todo:
document

Definition at line 286 of file DateFormatter.php.

References $wgContLang.

Referenced by __construct().

Here is the caller graph for this function:

DateFormatter::makeIsoMonth ( monthName)

Makes an ISO month, e.g.

02, from a month name

Parameters:
$monthNameString: month name
Returns:
string ISO month name

Definition at line 301 of file DateFormatter.php.

References $n, and $wgContLang.

Referenced by formatDate().

Here is the caller graph for this function:

Todo:
document
Parameters:
$yearString: Year name
Returns:
string ISO year name

Definition at line 313 of file DateFormatter.php.

Referenced by formatDate().

Here is the caller graph for this function:

Todo:
document

Definition at line 329 of file DateFormatter.php.

Referenced by formatDate().

Here is the caller graph for this function:

DateFormatter::reformat ( preference,
text,
options = array('linked') 
)
Parameters:
$preferenceString: User preference
$textString: Text to reformat
$optionsArray: can contain 'linked' and/or 'match-whole'

Definition at line 126 of file DateFormatter.php.

References $options, ALL, LAST, and NONE.

DateFormatter::replace ( matches)
Parameters:
$matches

Definition at line 176 of file DateFormatter.php.

References $matches, and formatDate().

Here is the call graph for this function:


Member Data Documentation

DateFormatter::$monthNames = ''

Definition at line 16 of file DateFormatter.php.

DateFormatter::$mSource

Definition at line 15 of file DateFormatter.php.

DateFormatter::$mTarget

Definition at line 15 of file DateFormatter.php.

DateFormatter::$pDays

Definition at line 18 of file DateFormatter.php.

DateFormatter::$pMonths

Definition at line 18 of file DateFormatter.php.

DateFormatter::$preferences

Definition at line 19 of file DateFormatter.php.

DateFormatter::$pYears

Definition at line 18 of file DateFormatter.php.

DateFormatter::$regexes

Definition at line 18 of file DateFormatter.php.

DateFormatter::$rules

Definition at line 19 of file DateFormatter.php.

DateFormatter::$rxDM

Definition at line 16 of file DateFormatter.php.

DateFormatter::$rxDMY

Definition at line 16 of file DateFormatter.php.

DateFormatter::$rxMD

Definition at line 16 of file DateFormatter.php.

DateFormatter::$rxMDY

Definition at line 16 of file DateFormatter.php.

DateFormatter::$rxYDM

Definition at line 16 of file DateFormatter.php.

DateFormatter::$rxYMD

Definition at line 16 of file DateFormatter.php.

DateFormatter::$xMonths

Definition at line 19 of file DateFormatter.php.

const DateFormatter::ALL = -1

Definition at line 21 of file DateFormatter.php.

Referenced by __construct(), and reformat().

const DateFormatter::DM = 7

Definition at line 30 of file DateFormatter.php.

Referenced by __construct().

const DateFormatter::DMY = 2

Definition at line 24 of file DateFormatter.php.

Referenced by __construct().

Definition at line 26 of file DateFormatter.php.

Referenced by __construct().

Definition at line 28 of file DateFormatter.php.

Referenced by __construct().

Definition at line 32 of file DateFormatter.php.

Referenced by reformat().

Definition at line 27 of file DateFormatter.php.

const DateFormatter::MD = 8

Definition at line 31 of file DateFormatter.php.

Referenced by __construct().

const DateFormatter::MDY = 1

Definition at line 23 of file DateFormatter.php.

Referenced by __construct().

Definition at line 22 of file DateFormatter.php.

Referenced by __construct(), and reformat().

const DateFormatter::YDM = 6

Definition at line 29 of file DateFormatter.php.

Referenced by __construct().

const DateFormatter::YMD = 3

Definition at line 25 of file DateFormatter.php.

Referenced by __construct().


The documentation for this class was generated from the following file: