mirror of
https://github.com/Aviortheking/DeltaCMS.git
synced 2025-07-04 10:39:19 +00:00
Changed whole Input Objects
they now lives by themselves when before they where highly connected to Form.php
This commit is contained in:
@ -2,6 +2,26 @@
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user