Very basic cleaner that assumes the date is Gregorian and only ensures it looks OK.
More...
|
| __construct ( $xsd11=true) |
|
| getStandardValue (TimeValue $value) |
| Get standardized dateTime value, compatible with xsd:dateTime If the value cannot be converted to it, returns null.
|
|
Very basic cleaner that assumes the date is Gregorian and only ensures it looks OK.
- Copyright
- GPL-2.0-or-later
- Author
- Stas Malyshev
-
Thiemo Kreuz
◆ __construct()
Wikibase\Repo\Rdf\DateTimeValueCleaner::__construct |
( |
|
$xsd11 = true | ) |
|
- Parameters
-
bool | $xsd11 | Should we use XSD 1.1 standard? |
◆ cleanupGregorianValue()
Wikibase\Repo\Rdf\DateTimeValueCleaner::cleanupGregorianValue |
( |
|
$dateValue, |
|
|
|
$precision |
|
) |
| |
|
protected |
Clean up Wikidata date value in Gregorian calendar.
- remove + from the start - not all data stores like that
- validate month and date value
- Parameters
-
string | $dateValue | |
int | $precision | Date precision constant (e.g. TimeValue::PRECISION_SECOND) |
- Returns
- string|null Value compatible with xsd:dateTime type, null if we failed to parse
◆ getStandardValue()
Wikibase\Repo\Rdf\DateTimeValueCleaner::getStandardValue |
( |
TimeValue |
$value | ) |
|
◆ parseDateValue()
Wikibase\Repo\Rdf\DateTimeValueCleaner::parseDateValue |
( |
|
$dateValue | ) |
|
|
protected |
Parse date value and fix weird numbers there.
- Parameters
-
- Exceptions
-
IllegalValueException | if the input is an illegal XSD 1.0 timestamp |
- Returns
- array Parsed value in parts: $minus, $y, $m, $d, $time
◆ $xsd11
Wikibase\Repo\Rdf\DateTimeValueCleaner::$xsd11 = true |
|
protected |
The documentation for this class was generated from the following file: