72 $value = parent::extractValue($fieldType, $field, $request);
73 if (is_string($value) && !\CBPHelper::isEmptyValue($value))
75 if (\CBPActivity::isExpression($value))
80 if (Value\Time::isCorrect($value))
82 $value =
new Value\Time($value, \CTimeZone::GetOffset());
84 return $value->serialize();
88 'code' =>
'ErrorValue',
98 $offset = \CTimeZone::GetOffset();
99 $timestampA = (
new Value\Time((
string)$valueA, $offset))->getTimestamp();
100 $timestampB = (
new Value\Time((
string)$valueB, $offset))->getTimestamp();
102 return parent::compareValues($timestampA, $timestampB);
107 $name = static::generateControlName($field);
108 $value = static::internalizeValue($fieldType,
'Renderer', $value);
109 if ($value instanceof Value\
Time)
111 $value = $value->toSystemObject()->format(Value\Time::getRenderFormat());
113 $className = static::generateControlClassName($fieldType, $field);
115 $renderResult =
'<select name="' . htmlspecialcharsbx($name) .
'" class="' . htmlspecialcharsbx($className) .
'">';
116 $renderResult .=
'<option value="">' .
Loc::getMessage(
'BPDT_TIME_NOT_SET') .
'</option>';
117 $format = Value\Time::getFormat();
118 for ($hour = 0; $hour < 24; $hour++)
120 $time = (new \Bitrix\Main\Type\DateTime())->setTime($hour, 0);
123 ($value === $time->format(Value\Time::getRenderFormat()))
127 $timeValue = htmlspecialcharsbx($time->format(Value\Time::getRenderFormat()));
128 $timeText = htmlspecialcharsbx($time->format($format));
129 $renderResult .=
'<option value="' . $timeValue .
'"' . $selected .
'>' . $timeText .
'</option>';
131 $time = (new \Bitrix\Main\Type\DateTime())->setTime($hour, 30);
133 ($value === $time->format(Value\Time::getRenderFormat()))
137 $timeValue = htmlspecialcharsbx($time->format(Value\Time::getRenderFormat()));
138 $timeText = htmlspecialcharsbx($time->format($format));
139 $renderResult .=
'<option value="' . $timeValue .
'"' . $selected .
'>' . $timeText .
'</option>';
142 $renderResult .=
'</select>';
144 return $renderResult;
195 ? (new \Bitrix\Bizproc\BaseType\Value\Time((
string)$value, \CTimeZone::GetOffset()))->getTimestamp()