mirror of
https://github.com/Aviortheking/DeltaCMS.git
synced 2025-04-23 03:12:14 +00:00
they now lives by themselves when before they where highly connected to Form.php
28 lines
557 B
PHP
28 lines
557 B
PHP
<?php
|
|
|
|
namespace AdminPanel\Form;
|
|
|
|
use DateTime;
|
|
|
|
class DateInput extends AbstractInput
|
|
{
|
|
|
|
public function getOption(string $name)
|
|
{
|
|
if ($name === "value") {
|
|
return new DateTime($this->options["name"]);
|
|
} else {
|
|
return parent::getOption($name);
|
|
}
|
|
}
|
|
|
|
public function setOption($name, $value)
|
|
{
|
|
if ($name === "value") {
|
|
$this->attributes["value"] = (new DateTime($value))->format('Y-m-d');
|
|
} else {
|
|
parent::setOption($name, $value);
|
|
}
|
|
}
|
|
}
|