| Total Complexity | 5 |
| Total Lines | 71 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 7 | class DateTime extends Field |
||
| 8 | { |
||
| 9 | /** @var string */ |
||
| 10 | protected $dateFormat = 'M j, Y'; |
||
| 11 | |||
| 12 | /** @var string */ |
||
| 13 | protected $timeFormat = 'g:i A'; |
||
| 14 | |||
| 15 | /** @var string */ |
||
| 16 | protected $dateTimeFormat = 'M j, Y g:i A'; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * @return array |
||
| 20 | */ |
||
| 21 | public function onIndex(): array |
||
| 33 | ]; |
||
| 34 | } |
||
| 35 | |||
| 36 | /** |
||
| 37 | * @return array |
||
| 38 | */ |
||
| 39 | public function onView(): array |
||
| 40 | { |
||
| 41 | return $this->onIndex(); |
||
| 42 | } |
||
| 43 | |||
| 44 | /** |
||
| 45 | * @param string $format |
||
| 46 | * |
||
| 47 | * @return self |
||
| 48 | */ |
||
| 49 | public function setDateTimeFormat(string $format): self |
||
| 50 | { |
||
| 51 | $this->$dateTimeFormat = $format; |
||
|
|
|||
| 52 | |||
| 53 | return $this; |
||
| 54 | } |
||
| 55 | |||
| 56 | /** |
||
| 57 | * @param string $dateFormat |
||
| 58 | * |
||
| 59 | * @return self |
||
| 60 | */ |
||
| 61 | public function setDateFormat(string $dateFormat): self |
||
| 66 | } |
||
| 67 | |||
| 68 | /** |
||
| 69 | * @param string $timeFormat |
||
| 70 | * |
||
| 71 | * @return self |
||
| 72 | */ |
||
| 73 | public function setTimeFormat(string $timeFormat): self |
||
| 78 | } |
||
| 79 | } |
||
| 80 |