12 private const INTERNAL_FORMAT =
'YYYY-MM-DD';
19 'DESCRIPTION' => Loc::getMessage(
'IBLOCK_PROP_DATE_DESC'),
21 'GetPublicViewHTML' => [__CLASS__,
'GetPublicViewHTML'],
22 'GetPublicEditHTML' => [__CLASS__,
'GetPublicEditHTML'],
23 'GetPublicEditHTMLMulty' => [__CLASS__,
'GetPublicEditHTMLMulty'],
24 'GetAdminListViewHTML' => [__CLASS__,
'GetAdminListViewHTML'],
25 'GetPropertyFieldHtml' => [__CLASS__,
'GetPropertyFieldHtml'],
26 'CheckFields' => [__CLASS__,
'CheckFields'],
27 'ConvertToDB' => [__CLASS__,
'ConvertToDB'],
28 'ConvertFromDB' => [__CLASS__,
'ConvertFromDB'],
29 'GetSettingsHTML' => [__CLASS__,
'GetSettingsHTML'],
30 'GetAdminFilterHTML' => [__CLASS__,
'GetAdminFilterHTML'],
31 'GetPublicFilterHTML' => [__CLASS__,
'GetPublicFilterHTML'],
32 'AddFilterFields' => [__CLASS__,
'AddFilterFields'],
33 'GetUIFilterProperty' => [__CLASS__,
'GetUIFilterProperty'],
34 'GetUIEntityEditorProperty' => [__CLASS__,
'GetUIEntityEditorProperty'],
48 $valueEntity->addField(
50 ->configureFormat(parent::FORMAT_SHORT)
51 ->configureColumnName($valueEntity->getField(
'VALUE')->getColumnName())
57 $dateTimeValue = (string)($value[
'VALUE'] ??
'');
58 if ($dateTimeValue !==
'')
60 if (!static::checkInternalFormatValue($dateTimeValue))
62 $value[
'VALUE'] = CDatabase::FormatDate(
64 CLang::GetDateFormat(
'SHORT'),
70 $value[
'VALUE'] = $dateTimeValue;
79 $dateTimeValue = (string)($value[
'VALUE'] ??
'');
80 if ($dateTimeValue !==
'')
82 $value[
'VALUE'] = CDatabase::FormatDate(
84 self::INTERNAL_FORMAT,
85 CLang::GetDateFormat(
'SHORT')
92 public static function GetPublicEditHTML($arProperty, $value, $strHTMLControlName)
99 'bitrix:iblock.property.field.public.edit',
102 'NAME' => $strHTMLControlName[
'VALUE'],
103 'VALUE' => static::prepareMultiValue($value),
104 'PROPERTY' => $arProperty,
118 public static function GetPublicEditHTMLMulty($arProperty, $value, $strHTMLControlName): string
125 'bitrix:iblock.property.field.public.edit',
128 'NAME' => $strHTMLControlName[
'VALUE'],
129 'VALUE' => static::prepareMultiValue($value),
130 'PROPERTY' => $arProperty,
147 return static::getPropertyFormField($arProperty, $value, $strHTMLControlName,
false);
170 $culture = Context::getCurrent()->getCulture();
172 $dateTimeResult = parent::GetUIEntityEditorProperty(
$settings, $value);
173 $dateTimeResult[
'data'] = [
174 'enableTime' =>
false,
175 'dateViewFormat' =>
$culture->getLongDateFormat(),
178 return $dateTimeResult;
188 $correctValue = date_parse_from_format(parent::FORMAT_SHORT, $value);
190 return ($correctValue[
'warning_count'] === 0 && $correctValue[
'error_count'] === 0);
static GetUIFilterProperty($property, $control, &$fields)
static GetPropertyFieldHtml($arProperty, $value, $strHTMLControlName)
static GetUserTypeDescription()
static GetUIEntityEditorProperty($settings, $value)
static GetORMFields($valueEntity, $property)
static checkInternalFormatValue(string $value)
static ConvertToDB($arProperty, $value)
static ConvertFromDB($arProperty, $value, $format='')