19 declare(strict_types=1);
51 $ui = $DIC->ui()->factory();
53 $request = $DIC->http()->request();
58 $duration = $ui->input()->field()->duration(
"Pick a time-span",
"This is the byline text");
60 ->withTimezone(
'America/El_Salvador')
62 ->withByline(
'timezone and both time and date');
64 $time =
$duration->withTimeOnly(
true)->withRequired(
true)->withLabels(
'start time',
'end time');
67 $form = $ui->input()->container()->form()->standard(
72 'timezone' => $timezone,
73 'disabled' =>
$duration->withLabel(
'disabled')->withDisabled(
true)
80 if ($request->getMethod() ==
"POST") {
81 $form = $form->withRequest($request);
82 $groups = $form->getInputs();
83 foreach ($groups as $group) {
84 if ($group->getError()) {
85 $result = $group->getError();
88 $result = $form->getData();
92 $result =
"No result yet.";
97 "<pre>" . print_r($result,
true) .
"</pre><br/>" .