$form['content_translation'
]['uid'
] =
[ '#type' => 'entity_autocomplete',
'#title' =>
t('Authored by'
),
'#target_type' => 'user',
'#default_value' => User::
load($uid),
// Validation is done by static::entityFormValidate().
'#validate_reference' => FALSE,
'#maxlength' => 60,
'#description' =>
t('Leave blank for %anonymous.',
['%anonymous' => \Drupal::
config('user.settings'
)->
get('anonymous'
)]),
];
$date =
$new_translation ? REQUEST_TIME :
$metadata->
getCreatedTime();
$form['content_translation'
]['created'
] =
[ '#type' => 'textfield',
'#title' =>
t('Authored on'
),
'#maxlength' => 25,
'#description' =>
t('Format: %time. The date format is YYYY-MM-DD and %timezone is the time zone offset from UTC. Leave blank to use the time of form submission.',
[ '%time' =>
$this->dateFormatter->
format(REQUEST_TIME, 'custom', 'Y-m-d H:i:s O'
),
'%timezone' =>
$this->dateFormatter->
format(REQUEST_TIME, 'custom', 'O'
),
]),
'#default_value' =>
$new_translation || !
$date ? '' :
$this->dateFormatter->
format($date, 'custom', 'Y-m-d H:i:s O'
),
];