@@ 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-46 (lines=27) @@ | ||
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 | $this->value = $v->format('---d'); |
|
40 | } |
|
41 | ||
42 | protected function isOK() |
|
43 | { |
|
44 | $this->CheckMinMax(new \Date($this->value)); |
|
45 | } |
|
46 | } |
|
47 |
@@ 19-45 (lines=27) @@ | ||
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 | $this->value = $v->format('--m'); |
|
39 | } |
|
40 | ||
41 | protected function isOK() |
|
42 | { |
|
43 | $this->CheckMinMax(new \Date($this->value)); |
|
44 | } |
|
45 | } |
|
46 |
@@ 19-45 (lines=27) @@ | ||
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 | $this->value = $v->format('--m-d'); |
|
39 | } |
|
40 | ||
41 | protected function isOK() |
|
42 | { |
|
43 | $this->CheckMinMax(new \Date($this->value)); |
|
44 | } |
|
45 | } |
|
46 |
@@ 19-45 (lines=27) @@ | ||
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 | $this->value = $v->format('Y'); |
|
39 | } |
|
40 | ||
41 | protected function isOK() |
|
42 | { |
|
43 | $this->CheckMinMax(new \Date($this->value)); |
|
44 | } |
|
45 | } |
|
46 |
@@ 20-46 (lines=27) @@ | ||
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 | $this->value = $v->format('Y-m'); |
|
40 | } |
|
41 | ||
42 | protected function isOK() |
|
43 | { |
|
44 | $this->CheckMinMax(new \Date($this->value)); |
|
45 | } |
|
46 | } |
|
47 |