Conditions | 5 |
Paths | 9 |
Total Lines | 22 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 1 | Features | 0 |
1 | <?php declare(strict_types=1); |
||
13 | public function editable($value, Field $field, HTMLNode $previous): HTMLNode |
||
14 | { |
||
15 | $element = parent::editable($value, $field, $previous); |
||
16 | $input = $element->get('input')[0]; |
||
17 | $input->setAttribute('type', 'date'); |
||
18 | |||
19 | $min = $field->getValidatorOption(Min::class); |
||
20 | if ($min) { |
||
21 | if ($min === 'now') { |
||
22 | $min = Datatype_date::fromString($min); |
||
23 | } |
||
24 | $input->setAttribute('min', $min); |
||
25 | } |
||
26 | $max = $field->getValidatorOption(Max::class); |
||
27 | if ($max) { |
||
28 | if ($max === 'now') { |
||
29 | $max = Datatype_date::fromString($max); |
||
30 | } |
||
31 | $input->setAttribute('max', $max); |
||
32 | } |
||
33 | |||
34 | return $element; |
||
35 | } |
||
37 |