return [$form_state->
getValue('default_value_input'
)];
} return [];
} /**
* {@inheritdoc}
*/
public static function processDefaultValue($default_value, FieldableEntityInterface
$entity, FieldDefinitionInterface
$definition) { // Explicitly call the base class so that we can get the default value
// types.
$default_value = FieldItemList::
processDefaultValue($default_value,
$entity,
$definition);
// Allow either the start or end date to have a default, but not require
// defaults for both.
if (!
empty($default_value[0
]['default_date_type'
]) || !
empty($default_value[0
]['default_end_date_type'
])) { // A default value should be in the format and timezone used for date
// storage. All-day ranges are stored the same as date+time ranges. We
// only provide a default value for the first item, as do all fields.
// Otherwise, there is no way to clear out unwanted values on multiple
// value fields.
$storage_format =
$definition->
getSetting('datetime_type'
) == DateRangeItem::DATETIME_TYPE_DATE ? DateTimeItemInterface::DATE_STORAGE_FORMAT : DateTimeItemInterface::DATETIME_STORAGE_FORMAT;
$default_values =
[[]];