69 $field_factory->dateTime(
'start'),
70 $field_factory->dateTime(
'end')
87 $duration = $this->refinery->custom()->transformation(
function ($v) {
88 list($from, $until) = $v;
89 if ($from && $until) {
90 return [
'start' => $from,
'end' => $until,
'interval' => $from->diff($until)];
94 $this->setAdditionalTransformation($duration);
102 $txt_id =
'duration_end_must_not_be_earlier_than_start';
103 $error =
function (callable
$txt, $value) use ($txt_id) {
104 return $txt($txt_id, $value);
106 $is_ok =
function ($v) {
110 return $v[
'start'] < $v[
'end'];
113 $from_before_until = $this->refinery->custom()->constraint($is_ok, $error);
114 $this->setAdditionalTransformation($from_before_until);
122 $clone = clone $this;
124 $clone->applyFormat();
141 $this->inputs = array_map(
143 return $inpt->withFormat($this->
getFormat());
154 $clone = clone $this;
155 $clone->min_date = $date;
156 $clone->applyMinValue();
165 $this->inputs = array_map(
178 return $this->min_date;
186 $clone = clone $this;
187 $clone->max_date = $date;
188 $clone->applyMaxValue();
197 $this->inputs = array_map(
210 return $this->max_date;
218 $clone = clone $this;
219 $clone->with_time_only = $with_time_only;
220 $clone->applyWithTimeOnly();
229 $this->inputs = array_map(
242 return $this->with_time_only;
250 $clone = clone $this;
251 $clone->with_time = $with_time;
252 $clone->applyWithUseTime();
261 return $this->with_time;
269 $this->inputs = array_map(
271 return $inpt->withUseTime($this->
getUseTime());
282 $clone = clone $this;
283 $clone->timezone = $tz;
284 $clone->inputs = array_map(
285 function ($inpt) use ($tz) {
286 return $inpt->withTimezone($tz);
298 return $this->timezone;
322 return function ($id) {
323 $code =
"var combinedDuration = function() { 325 $('#$id').find('input').each(function() { 326 options.push($(this).val()); 328 return options.join(' - '); 330 $('#$id').on('input dp.change', function(event) { 331 il.UI.input.onFieldUpdate(event, '$id', combinedDuration()); 333 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)