Wikibase
MediaWiki Wikibase extension
Loading...
Searching...
No Matches
Wikibase\Lib\Formatters\MwTimeIsoFormatter Class Reference
+ Inheritance diagram for Wikibase\Lib\Formatters\MwTimeIsoFormatter:
+ Collaboration diagram for Wikibase\Lib\Formatters\MwTimeIsoFormatter:

Public Member Functions

 __construct (LanguageFactory $languageFactory, FormatterOptions $options=null)
 
 format ( $value)
 

Private Member Functions

 formatTimeValue (TimeValue $timeValue)
 
 getLocalizedDate ( $isoTimestamp, $precision)
 
 getDateFormat ( $precision)
 
 getDayFormat ( $dateFormat)
 
 getMonthFormat ( $dateFormat)
 
 getMwTimestamp ( $isoTimestamp, $precision)
 
 splitIsoTimestamp ( $isoTimestamp, $precision)
 
 getLocalizedYear ( $isoTimestamp, $precision)
 
 shiftNumber ( $number, $function, $shift, $unshift)
 

Private Attributes

 $language
 
 $options
 

Detailed Description

Author
H. Snater < media.nosp@m.wiki.nosp@m.@snat.nosp@m.er.c.nosp@m.om >
Addshore
Thiemo Kreuz
Todo:
move me to DataValues-time

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Lib\Formatters\MwTimeIsoFormatter::__construct ( LanguageFactory  $languageFactory,
FormatterOptions  $options = null 
)
Parameters
LanguageFactory$languageFactory
FormatterOptions | null$options

Member Function Documentation

◆ format()

Wikibase\Lib\Formatters\MwTimeIsoFormatter::format (   $value)
See also
ValueFormatter::format
Parameters
TimeValue$value
Exceptions
InvalidArgumentException
Returns
string Text

◆ formatTimeValue()

Wikibase\Lib\Formatters\MwTimeIsoFormatter::formatTimeValue ( TimeValue  $timeValue)
private
Parameters
TimeValue$timeValue
Returns
string Text

◆ getDateFormat()

Wikibase\Lib\Formatters\MwTimeIsoFormatter::getDateFormat (   $precision)
private
Parameters
int$precision
Exceptions
InvalidArgumentException
Returns
string Date format string to be used by Language::sprintfDate

◆ getDayFormat()

Wikibase\Lib\Formatters\MwTimeIsoFormatter::getDayFormat (   $dateFormat)
private
See also
Language::sprintfDate
Parameters
string$dateFormat
Returns
string A date format for the day that roundtrips the Wikibase TimeParsers.

◆ getLocalizedDate()

Wikibase\Lib\Formatters\MwTimeIsoFormatter::getLocalizedDate (   $isoTimestamp,
  $precision 
)
private
Parameters
string$isoTimestamp
int$precision
Exceptions
InvalidArgumentException
Returns
string Formatted date

◆ getLocalizedYear()

Wikibase\Lib\Formatters\MwTimeIsoFormatter::getLocalizedYear (   $isoTimestamp,
  $precision 
)
private
Parameters
string$isoTimestamp
int$precision
Returns
string

◆ getMonthFormat()

Wikibase\Lib\Formatters\MwTimeIsoFormatter::getMonthFormat (   $dateFormat)
private
See also
Language::sprintfDate
Parameters
string$dateFormat
Returns
string A date format for the month that roundtrips the Wikibase TimeParsers.

◆ getMwTimestamp()

Wikibase\Lib\Formatters\MwTimeIsoFormatter::getMwTimestamp (   $isoTimestamp,
  $precision 
)
private
Parameters
string$isoTimestamp
int$precision
Exceptions
InvalidArgumentException
Returns
string MediaWiki time stamp in the format YYYYMMDDHHMMSS

◆ shiftNumber()

Wikibase\Lib\Formatters\MwTimeIsoFormatter::shiftNumber (   $number,
  $function,
  $shift,
  $unshift 
)
private
Parameters
string$number
string$function
float$shift
float$unshift
Returns
string

◆ splitIsoTimestamp()

Wikibase\Lib\Formatters\MwTimeIsoFormatter::splitIsoTimestamp (   $isoTimestamp,
  $precision 
)
private
Parameters
string$isoTimestamp
int$precision
Exceptions
InvalidArgumentException
Returns
string[] Year, month, day, hour, minute, second

Member Data Documentation

◆ $language

Wikibase\Lib\Formatters\MwTimeIsoFormatter::$language
private

◆ $options

Wikibase\Lib\Formatters\MwTimeIsoFormatter::$options
private

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