| @@ 19-45 (lines=27) @@ | ||
| 16 | * unknown; it is not assumed to be UTC. |
|
| 17 | * @package AlgoWeb\xsdTypes |
|
| 18 | */ |
|
| 19 | class xsDateTime extends xsAnySimpleType |
|
| 20 | { |
|
| 21 | use MinMaxTrait; |
|
| 22 | ||
| 23 | /** |
|
| 24 | * Construct. |
|
| 25 | * |
|
| 26 | * @param string $value |
|
| 27 | */ |
|
| 28 | public function __construct($value) |
|
| 29 | { |
|
| 30 | parent::__construct($value); |
|
| 31 | $this->setWhiteSpaceFacet('collapse'); |
|
| 32 | } |
|
| 33 | ||
| 34 | public function fixValue() |
|
| 35 | { |
|
| 36 | parent::fixValue(); |
|
| 37 | $v = new \DateTime($this->value); |
|
| 38 | $this->value = $v->format(\DateTime::RFC3339); |
|
| 39 | } |
|
| 40 | ||
| 41 | protected function isOK() |
|
| 42 | { |
|
| 43 | $this->CheckMinMax(new \Date($this->value)); |
|
| 44 | } |
|
| 45 | } |
|
| 46 | ||
| @@ 20-47 (lines=28) @@ | ||
| 17 | * unknown; it is not assumed to be UTC. |
|
| 18 | * @package AlgoWeb\xsdTypes |
|
| 19 | */ |
|
| 20 | class xsGDay extends xsAnySimpleType |
|
| 21 | { |
|
| 22 | use MinMaxTrait; |
|
| 23 | ||
| 24 | /** |
|
| 25 | * Construct. |
|
| 26 | * |
|
| 27 | * @param string $value |
|
| 28 | */ |
|
| 29 | public function __construct($value) |
|
| 30 | { |
|
| 31 | parent::__construct($value); |
|
| 32 | $this->setWhiteSpaceFacet('collapse'); |
|
| 33 | } |
|
| 34 | ||
| 35 | public function fixValue() |
|
| 36 | { |
|
| 37 | parent::fixValue(); |
|
| 38 | $v = new \DateTime($this->value); |
|
| 39 | //TODO: TechDebt, This needs to format to |
|
| 40 | $this->value = $v->format(\DateTime::RFC3339); |
|
| 41 | } |
|
| 42 | ||
| 43 | protected function isOK() |
|
| 44 | { |
|
| 45 | $this->CheckMinMax(new \Date($this->value)); |
|
| 46 | } |
|
| 47 | } |
|
| 48 | ||
| @@ 19-46 (lines=28) @@ | ||
| 16 | * unknown; it is not assumed to be UTC. |
|
| 17 | * @package AlgoWeb\xsdTypes |
|
| 18 | */ |
|
| 19 | class xsGMonth extends xsAnySimpleType |
|
| 20 | { |
|
| 21 | use MinMaxTrait; |
|
| 22 | ||
| 23 | /** |
|
| 24 | * Construct. |
|
| 25 | * |
|
| 26 | * @param string $value |
|
| 27 | */ |
|
| 28 | public function __construct($value) |
|
| 29 | { |
|
| 30 | parent::__construct($value); |
|
| 31 | $this->setWhiteSpaceFacet('collapse'); |
|
| 32 | } |
|
| 33 | ||
| 34 | public function fixValue() |
|
| 35 | { |
|
| 36 | parent::fixValue(); |
|
| 37 | $v = new \DateTime($this->value); |
|
| 38 | //TODO: TechDebt, This needs to format to |
|
| 39 | $this->value = $v->format(\DateTime::RFC3339); |
|
| 40 | } |
|
| 41 | ||
| 42 | protected function isOK() |
|
| 43 | { |
|
| 44 | $this->CheckMinMax(new \Date($this->value)); |
|
| 45 | } |
|
| 46 | } |
|
| 47 | ||
| @@ 19-46 (lines=28) @@ | ||
| 16 | * unknown; it is not assumed to be UTC. |
|
| 17 | * @package AlgoWeb\xsdTypes |
|
| 18 | */ |
|
| 19 | class xsGMonthDay extends xsAnySimpleType |
|
| 20 | { |
|
| 21 | use MinMaxTrait; |
|
| 22 | ||
| 23 | /** |
|
| 24 | * Construct. |
|
| 25 | * |
|
| 26 | * @param string $value |
|
| 27 | */ |
|
| 28 | public function __construct($value) |
|
| 29 | { |
|
| 30 | parent::__construct($value); |
|
| 31 | $this->setWhiteSpaceFacet('collapse'); |
|
| 32 | } |
|
| 33 | ||
| 34 | public function fixValue() |
|
| 35 | { |
|
| 36 | parent::fixValue(); |
|
| 37 | $v = new \DateTime($this->value); |
|
| 38 | //TODO: TechDebt, This needs to format to |
|
| 39 | $this->value = $v->format(\DateTime::RFC3339); |
|
| 40 | } |
|
| 41 | ||
| 42 | protected function isOK() |
|
| 43 | { |
|
| 44 | $this->CheckMinMax(new \Date($this->value)); |
|
| 45 | } |
|
| 46 | } |
|
| 47 | ||
| @@ 19-46 (lines=28) @@ | ||
| 16 | * unknown; it is not assumed to be UTC. |
|
| 17 | * @package AlgoWeb\xsdTypes |
|
| 18 | */ |
|
| 19 | class xsGYear extends xsAnySimpleType |
|
| 20 | { |
|
| 21 | use MinMaxTrait; |
|
| 22 | ||
| 23 | /** |
|
| 24 | * Construct. |
|
| 25 | * |
|
| 26 | * @param string $value |
|
| 27 | */ |
|
| 28 | public function __construct($value) |
|
| 29 | { |
|
| 30 | parent::__construct($value); |
|
| 31 | $this->setWhiteSpaceFacet('collapse'); |
|
| 32 | } |
|
| 33 | ||
| 34 | public function fixValue() |
|
| 35 | { |
|
| 36 | parent::fixValue(); |
|
| 37 | $v = new \DateTime($this->value); |
|
| 38 | //TODO: TechDebt, This needs to format to |
|
| 39 | $this->value = $v->format('Y'); |
|
| 40 | } |
|
| 41 | ||
| 42 | protected function isOK() |
|
| 43 | { |
|
| 44 | $this->CheckMinMax(new \Date($this->value)); |
|
| 45 | } |
|
| 46 | } |
|
| 47 | ||
| @@ 20-47 (lines=28) @@ | ||
| 17 | * unknown; it is not assumed to be UTC. |
|
| 18 | * @package AlgoWeb\xsdTypes |
|
| 19 | */ |
|
| 20 | class xsGYearMonth extends xsAnySimpleType |
|
| 21 | { |
|
| 22 | use MinMaxTrait; |
|
| 23 | ||
| 24 | /** |
|
| 25 | * Construct. |
|
| 26 | * |
|
| 27 | * @param string $value |
|
| 28 | */ |
|
| 29 | public function __construct($value) |
|
| 30 | { |
|
| 31 | parent::__construct($value); |
|
| 32 | $this->setWhiteSpaceFacet('collapse'); |
|
| 33 | } |
|
| 34 | ||
| 35 | public function fixValue() |
|
| 36 | { |
|
| 37 | parent::fixValue(); |
|
| 38 | $v = new \DateTime($this->value); |
|
| 39 | //TODO: TechDebt, This needs to format to |
|
| 40 | $this->value = $v->format(\DateTime::RFC3339); |
|
| 41 | } |
|
| 42 | ||
| 43 | protected function isOK() |
|
| 44 | { |
|
| 45 | $this->CheckMinMax(new \Date($this->value)); |
|
| 46 | } |
|
| 47 | } |
|
| 48 | ||