| @@ 20-39 (lines=20) @@ | ||
| 17 | * - If no time items (hour, minute, second) are present, the letter T must not appear. |
|
| 18 | * @package AlgoWeb\xsdTypes |
|
| 19 | */ |
|
| 20 | class xsDayTimeDuration extends xsDuration |
|
| 21 | { |
|
| 22 | /** |
|
| 23 | * Construct |
|
| 24 | * |
|
| 25 | * @param string $value |
|
| 26 | */ |
|
| 27 | public function __construct($value) |
|
| 28 | { |
|
| 29 | parent::__construct($value); |
|
| 30 | $this->setWhiteSpaceFacet("collapse"); |
|
| 31 | } |
|
| 32 | ||
| 33 | public function fixValue() |
|
| 34 | { |
|
| 35 | parent::fixValue(); |
|
| 36 | $v = new \DateInterval($this->value); |
|
| 37 | $this->value = $this->format($v, 'PnDTnHnMnS'); |
|
| 38 | } |
|
| 39 | } |
|
| 40 | ||
| @@ 19-38 (lines=20) @@ | ||
| 16 | * Schema 1.0 specification and is therefore not supported for use in XML Schema 1.0 schemas. |
|
| 17 | * @package AlgoWeb\xsdTypes |
|
| 18 | */ |
|
| 19 | class xsYearMonthDuration extends xsDuration |
|
| 20 | { |
|
| 21 | /** |
|
| 22 | * Construct |
|
| 23 | * |
|
| 24 | * @param string $value |
|
| 25 | */ |
|
| 26 | public function __construct($value) |
|
| 27 | { |
|
| 28 | parent::__construct($value); |
|
| 29 | $this->setWhiteSpaceFacet("collapse"); |
|
| 30 | } |
|
| 31 | ||
| 32 | public function fixValue() |
|
| 33 | { |
|
| 34 | parent::fixValue(); |
|
| 35 | $v = new \DateInterval($this->value); |
|
| 36 | $this->value = $this->format($v, 'PnYnM'); |
|
| 37 | } |
|
| 38 | } |
|
| 39 | ||