|
MediaWiki
REL1_23
|
Date formatter, recognises dates in plain text and formats them according to user preferences. More...
Public Member Functions | |
| __construct (Language $lang) | |
| 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 ($lang=null) |
| 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 |
Protected Attributes | |
| $lang | |
Date formatter, recognises dates in plain text and formats them according to user preferences.
Definition at line 29 of file DateFormatter.php.
| DateFormatter::__construct | ( | Language $ | lang | ) |
| DateFormatter::formatDate | ( | $ | bits, |
| $ | link = true |
||
| ) |
| $bits | array |
| $link | bool |
Definition at line 222 of file DateFormatter.php.
References $link, $matches, array(), makeIsoMonth(), makeIsoYear(), makeNormalYear(), of, and Html\rawElement().
Referenced by replace().
| static& DateFormatter::getInstance | ( | $ | lang = null | ) | [static] |
Get a DateFormatter object.
| $lang | Language|string|null In which language to format the date Defaults to the site content language |
Definition at line 127 of file DateFormatter.php.
References $key, $lang, $wgContLang, $wgMemc, global, wfGetLangObj(), and wfMemcKey().
Referenced by CoreParserFunctions\formatDate().
Definition at line 318 of file DateFormatter.php.
References array().
Referenced by __construct().
| DateFormatter::makeIsoMonth | ( | $ | monthName | ) |
Makes an ISO month, e.g.
02, from a month name
| string | $monthName | month name |
Definition at line 332 of file DateFormatter.php.
References $n.
Referenced by formatDate().
| DateFormatter::makeIsoYear | ( | $ | year | ) |
| string | $year | Year name |
Definition at line 342 of file DateFormatter.php.
Referenced by formatDate().
| DateFormatter::makeNormalYear | ( | $ | iso | ) |
Definition at line 359 of file DateFormatter.php.
Referenced by formatDate().
| DateFormatter::reformat | ( | $ | preference, |
| $ | text, | ||
| $ | options = array( 'linked' ) |
||
| ) |
| DateFormatter::replace | ( | $ | matches | ) |
| $matches |
Definition at line 199 of file DateFormatter.php.
References $key, $matches, array(), and formatDate().
DateFormatter::$lang [protected] |
Definition at line 36 of file DateFormatter.php.
Referenced by __construct(), and getInstance().
| DateFormatter::$monthNames = '' |
Definition at line 31 of file DateFormatter.php.
| DateFormatter::$mSource |
Definition at line 30 of file DateFormatter.php.
| DateFormatter::$mTarget |
Definition at line 30 of file DateFormatter.php.
| DateFormatter::$pDays |
Definition at line 33 of file DateFormatter.php.
| DateFormatter::$pMonths |
Definition at line 33 of file DateFormatter.php.
| DateFormatter::$preferences |
Definition at line 34 of file DateFormatter.php.
| DateFormatter::$pYears |
Definition at line 33 of file DateFormatter.php.
| DateFormatter::$regexes |
Definition at line 33 of file DateFormatter.php.
| DateFormatter::$rules |
Definition at line 34 of file DateFormatter.php.
| DateFormatter::$rxDM |
Definition at line 31 of file DateFormatter.php.
| DateFormatter::$rxDMY |
Definition at line 31 of file DateFormatter.php.
| DateFormatter::$rxMD |
Definition at line 31 of file DateFormatter.php.
| DateFormatter::$rxMDY |
Definition at line 31 of file DateFormatter.php.
| DateFormatter::$rxYDM |
Definition at line 31 of file DateFormatter.php.
| DateFormatter::$rxYMD |
Definition at line 31 of file DateFormatter.php.
| DateFormatter::$xMonths |
Definition at line 34 of file DateFormatter.php.
| const DateFormatter::ALL = -1 |
Definition at line 38 of file DateFormatter.php.
Referenced by __construct(), and reformat().
| const DateFormatter::DM = 7 |
Definition at line 47 of file DateFormatter.php.
Referenced by __construct().
| const DateFormatter::DMY = 2 |
Definition at line 41 of file DateFormatter.php.
Referenced by __construct().
| const DateFormatter::ISO1 = 4 |
Definition at line 43 of file DateFormatter.php.
Referenced by __construct().
| const DateFormatter::ISO2 = 5 |
Definition at line 45 of file DateFormatter.php.
Referenced by __construct().
| const DateFormatter::LAST = 8 |
Definition at line 49 of file DateFormatter.php.
Referenced by reformat().
| const DateFormatter::LASTPREF = 4 |
Definition at line 44 of file DateFormatter.php.
| const DateFormatter::MD = 8 |
Definition at line 48 of file DateFormatter.php.
Referenced by __construct().
| const DateFormatter::MDY = 1 |
Definition at line 40 of file DateFormatter.php.
Referenced by __construct().
| const DateFormatter::NONE = 0 |
Definition at line 39 of file DateFormatter.php.
Referenced by __construct(), and reformat().
| const DateFormatter::YDM = 6 |
Definition at line 46 of file DateFormatter.php.
Referenced by __construct().
| const DateFormatter::YMD = 3 |
Definition at line 42 of file DateFormatter.php.
Referenced by __construct().