19declare(strict_types=1);
26use ILIAS\UI\Implementation\Component\ComponentHelper;
56 DataFactory $data_factory,
63 $this->format = $data_factory->dateFormat()->standard();
65 $datetime_trafo =
$refinery->to()->dateTime();
67 $this->setAdditionalTransformation($trafo);
72 return $this->
refinery->custom()->transformation(
73 function ($v) use ($or_trafo) {
77 return $or_trafo->transform($v);
94 if ($value instanceof \DateTimeImmutable) {
102 $clone = clone $this;
115 $timezone_trafo = $this->
refinery->dateTime()->changeTimezone($tz);
116 $clone = clone $this;
117 $clone->timezone = $tz;
120 $clone = $clone->withAdditionalTransformation($trafo);
131 $clone = clone $this;
143 $clone = clone $this;
155 $clone = clone $this;
167 $clone = clone $this;
168 $clone->with_time_only = $time_only;
179 if ($value instanceof \DateTimeImmutable || is_null($value)) {
183 if (!is_string($value)) {
188 new \DateTimeImmutable($value);
195 catch (\Throwable
$e) {
202 if ($this->requirement_constraint !==
null) {
203 return $this->requirement_constraint;
206 return $this->
refinery->logical()->sequential([
207 $this->
refinery->logical()->not($this->refinery->null()),
208 $this->refinery->string()->hasMinLength(1)
210 ->withProblemBuilder(fn(
$txt, $value) =>
$txt(
"datetime_required"));
229 $clone = clone $this;
230 $clone->additional_picker_config = array_merge($clone->additional_picker_config, $config);
236 return fn(
$id) =>
"$('#$id').on('input', function(event) {
237 il.UI.input.onFieldUpdate(event, '$id', $('#$id').find('input').val());
239 il.UI.input.onFieldUpdate(event, '$id', $('#$id').find('input').val());";
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
A constraint encodes some resrtictions on values.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
trait JavaScriptBindable
Trait for components implementing JavaScriptBindable providing standard implementation.
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.