Wikibase
MediaWiki Wikibase extension
Wikibase\Repo\Parsers\MwDateFormatParserFactory Class Reference

This factory creates a parser that accepts most outputs of MediaWiki's Language::sprintfDate formatting. More...

Public Member Functions

 getMwDateFormatParser ( $languageCode='en', $dateFormatPreference='dmy', $dateFormatType='date', ParserOptions $options=null)
 

Private Member Functions

 getCachedMonthNames (Language $language)
 
 getMwMonthNames (Language $language)
 
 trim ( $string)
 

Static Private Attributes

static $monthNamesCache = []
 

Detailed Description

This factory creates a parser that accepts most outputs of MediaWiki's Language::sprintfDate formatting.

Author
Thiemo Kreuz

Member Function Documentation

◆ getCachedMonthNames()

Wikibase\Repo\Parsers\MwDateFormatParserFactory::getCachedMonthNames ( Language  $language)
private
Parameters
Language$language
Returns
array[]

◆ getMwDateFormatParser()

Wikibase\Repo\Parsers\MwDateFormatParserFactory::getMwDateFormatParser (   $languageCode = 'en',
  $dateFormatPreference = 'dmy',
  $dateFormatType = 'date',
ParserOptions  $options = null 
)
Parameters
string$languageCode
string$dateFormatPreferenceTypically "dmy", "mdy", "ISO 8601" or "default", but this depends heavily on the actual MessagesXx.php file.
string$dateFormatTypeEither "date", "both" (date and time) or "monthonly".
ParserOptions | null$options
Exceptions
InvalidArgumentException
Returns
ValueParser

◆ getMwMonthNames()

Wikibase\Repo\Parsers\MwDateFormatParserFactory::getMwMonthNames ( Language  $language)
private
Parameters
Language$language
Returns
array[]

◆ trim()

Wikibase\Repo\Parsers\MwDateFormatParserFactory::trim (   $string)
private
Parameters
string$string
Returns
string

Member Data Documentation

◆ $monthNamesCache

Wikibase\Repo\Parsers\MwDateFormatParserFactory::$monthNamesCache = []
staticprivate

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