This parser is in essence the inverse operation of MediaWiki's Language::sprintfDate.
More...
This parser is in essence the inverse operation of MediaWiki's Language::sprintfDate.
- See also
- \Language::sprintfDate
- Copyright
- GPL-2.0-or-later
- Author
- Thiemo Kreuz
◆ __construct()
Wikibase\Repo\Parsers\DateFormatParser::__construct |
( |
ParserOptions |
$options = null | ) |
|
◆ findMonthMatch()
Wikibase\Repo\Parsers\DateFormatParser::findMonthMatch |
( |
|
$matches | ) |
|
|
private |
- Parameters
-
- Returns
- int|string
◆ getDateFormat()
Wikibase\Repo\Parsers\DateFormatParser::getDateFormat |
( |
| ) |
|
|
private |
◆ getDigitTransformTable()
Wikibase\Repo\Parsers\DateFormatParser::getDigitTransformTable |
( |
| ) |
|
|
private |
◆ getMonthNames()
Wikibase\Repo\Parsers\DateFormatParser::getMonthNames |
( |
| ) |
|
|
private |
◆ getMonthNamesPattern()
Wikibase\Repo\Parsers\DateFormatParser::getMonthNamesPattern |
( |
| ) |
|
|
private |
- Returns
- string Partial regular expression
◆ getNumberPattern()
Wikibase\Repo\Parsers\DateFormatParser::getNumberPattern |
( |
| ) |
|
|
private |
- Returns
- string Partial regular expression
◆ parseDate()
Wikibase\Repo\Parsers\DateFormatParser::parseDate |
( |
|
$input | ) |
|
|
private |
- Parameters
-
- Exceptions
-
- Returns
- string[] Guaranteed to have the "year" key, optionally followed by more elements. Guaranteed to be continuous, e.g. "year" and "day" with no "month" is illegal.
◆ parseDateFormat()
Wikibase\Repo\Parsers\DateFormatParser::parseDateFormat |
( |
|
$format | ) |
|
|
private |
- See also
- Language::sprintfDate
- Parameters
-
string | $format | A date format, as described in Language::sprintfDate. |
- Returns
- string Regular expression
◆ parseFormattedNumber()
Wikibase\Repo\Parsers\DateFormatParser::parseFormattedNumber |
( |
|
$number | ) |
|
|
private |
- Parameters
-
- Returns
- string Canonical number
◆ stringParse()
Wikibase\Repo\Parsers\DateFormatParser::stringParse |
( |
|
$value | ) |
|
|
protected |
- See also
- StringValueParser::stringParse
- Parameters
-
- Exceptions
-
- Returns
- TimeValue
◆ FORMAT_NAME
const Wikibase\Repo\Parsers\DateFormatParser::FORMAT_NAME = 'date-format' |
◆ OPT_DATE_FORMAT
const Wikibase\Repo\Parsers\DateFormatParser::OPT_DATE_FORMAT = 'dateFormat' |
◆ OPT_DIGIT_TRANSFORM_TABLE
const Wikibase\Repo\Parsers\DateFormatParser::OPT_DIGIT_TRANSFORM_TABLE = 'digitTransformTable' |
Option for unlocalizing non-canonical digits.
Must be an array of strings, mapping canonical digit characters ("1", "2" and so on, possibly including "." and ",") to localized characters.
◆ OPT_MONTH_NAMES
const Wikibase\Repo\Parsers\DateFormatParser::OPT_MONTH_NAMES = 'monthNames' |
Option for localized month names.
Should be a two-dimensional array, the first dimension mapping the month's numbers 1 to 12 to arrays of localized month names, possibly including full month names, genitive names and abbreviations. Can also be a one-dimensional array of strings.
◆ OPT_PRECISION
const Wikibase\Repo\Parsers\DateFormatParser::OPT_PRECISION = 'precision' |
Option to override the precision auto-detection and set a specific precision.
Should be an integer or string containing one of the TimeValue::PRECISION_... constants.
The documentation for this class was generated from the following file: