You are here

public function FeedsEntityProcessorPropertyDate::getFormField in Feeds entity processor 7

Implements FeedsEntityProcessorPropertyInterface::getFormField().

Adds a note about enabling the Date API module.

Overrides FeedsEntityProcessorPropertyDefault::getFormField

File

src/Property/FeedsEntityProcessorPropertyDate.php, line 18
Contains FeedsEntityProcessorPropertyDate.

Class

FeedsEntityProcessorPropertyDate
Handler for date property.

Code

public function getFormField(array &$form, array &$form_state, $default) {
  $field = parent::getFormField($form, $form_state, $default);
  if (!module_exists('date_api')) {
    $field['#description'] .= '<br />' . t('Enter a timestamp or enable the Date API module (part of the <a href="@url">Date</a> project) to be able to input the date in various date formats.', array(
      '@url' => 'https://www.drupal.org/project/date',
    ));
  }
  return $field;
}