You are here

function social_event_field_widget_form_alter in Open Social 8.5

Same name and namespace in other branches
  1. 8.9 modules/social_features/social_event/social_event.module \social_event_field_widget_form_alter()
  2. 8.3 modules/social_features/social_event/social_event.module \social_event_field_widget_form_alter()
  3. 8.4 modules/social_features/social_event/social_event.module \social_event_field_widget_form_alter()
  4. 8.6 modules/social_features/social_event/social_event.module \social_event_field_widget_form_alter()
  5. 8.7 modules/social_features/social_event/social_event.module \social_event_field_widget_form_alter()
  6. 8.8 modules/social_features/social_event/social_event.module \social_event_field_widget_form_alter()
  7. 10.3.x modules/social_features/social_event/social_event.module \social_event_field_widget_form_alter()
  8. 10.0.x modules/social_features/social_event/social_event.module \social_event_field_widget_form_alter()
  9. 10.1.x modules/social_features/social_event/social_event.module \social_event_field_widget_form_alter()
  10. 10.2.x modules/social_features/social_event/social_event.module \social_event_field_widget_form_alter()

Implements hook_field_widget_form_alter().

File

modules/social_features/social_event/social_event.module, line 534
The Social event module.

Code

function social_event_field_widget_form_alter(&$element, FormStateInterface $form_state, $context) {
  $field_definition = $context['items']
    ->getFieldDefinition();
  if ($field_definition
    ->getName() == 'field_event_date' || $field_definition
    ->getName() == 'field_event_date_end') {
    $element['value']['#date_time_callbacks'][] = 'social_event_date_all_day_checkbox';
  }
}