10 use ILIAS\Refinery\Transformation\Factory as TransformationFactory;
11 use ILIAS\Refinery\Validation\Factory as ValidationFactory;
75 $field_factory->dateTime(
'start'),
76 $field_factory->dateTime(
'end')
93 $duration = $this->refinery->custom()->transformation(
function ($v) {
94 list($from, $until) = $v;
95 if ($from && $until) {
96 return [
'start' => $from,
'end' => $until,
'interval' => $from->diff($until)];
100 $this->setAdditionalTransformation($duration);
108 $txt_id =
'duration_end_must_not_be_earlier_than_start';
109 $error =
function (callable
$txt, $value) use ($txt_id) {
110 return $txt($txt_id, $value);
112 $is_ok =
function ($v) {
116 return $v[
'start'] < $v[
'end'];
119 $from_before_until = $this->refinery->custom()->constraint($is_ok, $error);
120 $this->setAdditionalTransformation($from_before_until);
128 $clone = clone $this;
130 $clone->applyFormat();
147 $this->inputs = array_map(
149 return $inpt->withFormat($this->
getFormat());
160 $clone = clone $this;
161 $clone->min_date = $date;
162 $clone->applyMinValue();
171 $this->inputs = array_map(
184 return $this->min_date;
192 $clone = clone $this;
193 $clone->max_date = $date;
194 $clone->applyMaxValue();
203 $this->inputs = array_map(
216 return $this->max_date;
224 $clone = clone $this;
225 $clone->with_time_only = $with_time_only;
226 $clone->applyWithTimeOnly();
235 $this->inputs = array_map(
248 return $this->with_time_only;
256 $clone = clone $this;
257 $clone->with_time = $with_time;
258 $clone->applyWithUseTime();
267 return $this->with_time;
275 $this->inputs = array_map(
277 return $inpt->withUseTime($this->
getUseTime());
288 $trafo = $this->refinery->dateTime()->changeTimezone($tz);
289 $clone = clone $this;
290 $clone->timezone =
$tz;
292 $clone->inputs = array_map(
293 function ($inpt) use ($trafo) {
294 return $inpt->withAdditionalTransformation($trafo);
306 return $this->timezone;
330 return function ($id) {
331 $code =
"var combinedDuration = function() { 333 $('#$id').find('input').each(function() { 334 options.push($(this).val()); 336 return options.join(' - '); 338 $('#$id').on('input dp.change', function(event) { 339 il.UI.input.onFieldUpdate(event, '$id', combinedDuration()); 341 il.UI.input.onFieldUpdate(event, '$id', combinedDuration());";
Class ChatMainBarProvider .
trait JavaScriptBindable
Trait for components implementing JavaScriptBindable providing standard implementation.
trait ComponentHelper
Provides common functionality for component implementations.
__construct(Container $dic, ilPlugin $plugin)