BlueSpice MediaWiki master
 All Classes Namespaces Files Functions Variables Groups Pages
DateFormatter Class Reference
Collaboration diagram for DateFormatter:

Public Member Functions

 __construct (Language $lang)
 
 reformat ($preference, $text, $options=[ 'linked'])
 

Static Public Member Functions

static getInstance (Language $lang=null)
 

Public Attributes

 $mTarget
 
 $xMonths
 
 $preferences
 
 $mLinked
 
const ALL = -1
 
const NONE = 0
 
const MDY = 1
 
const DMY = 2
 
const YMD = 3
 
const ISO1 = 4
 
const LASTPREF = 4
 
const ISO2 = 5
 
const YDM = 6
 
const DM = 7
 
const MD = 8
 
const LAST = 8
 

Detailed Description

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

Todo:
preferences, OutputPage

Constructor & Destructor Documentation

DateFormatter::__construct ( Language  $lang)
Parameters
Language$langIn which language to format the date

Member Function Documentation

static DateFormatter::getInstance ( Language  $lang = null)
static

Get a DateFormatter object

Parameters
Language | null$langIn which language to format the date Defaults to the site content language
Returns
DateFormatter
DateFormatter::reformat (   $preference,
  $text,
  $options = [ 'linked' ] 
)
Parameters
string$preferenceUser preference
string$textText to reformat
array$optionsArray can contain 'linked' and/or 'match-whole'
Returns
string

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