You are here

function social_event_date_after_build 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_date_after_build()
  2. 8.3 modules/social_features/social_event/social_event.module \social_event_date_after_build()
  3. 8.4 modules/social_features/social_event/social_event.module \social_event_date_after_build()
  4. 8.6 modules/social_features/social_event/social_event.module \social_event_date_after_build()
  5. 8.7 modules/social_features/social_event/social_event.module \social_event_date_after_build()
  6. 8.8 modules/social_features/social_event/social_event.module \social_event_date_after_build()
  7. 10.3.x modules/social_features/social_event/social_event.module \social_event_date_after_build()
  8. 10.0.x modules/social_features/social_event/social_event.module \social_event_date_after_build()
  9. 10.1.x modules/social_features/social_event/social_event.module \social_event_date_after_build()
  10. 10.2.x modules/social_features/social_event/social_event.module \social_event_date_after_build()

Add custom validation to event date fields.

1 string reference to 'social_event_date_after_build'
social_event_form_alter in modules/social_features/social_event/social_event.module
Implements hook_form_alter().

File

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

Code

function social_event_date_after_build($form, &$form_state) {
  array_unshift($form['field_event_date']['widget'][0]['value']['#element_validate'], 'social_event_date_validate');
  array_unshift($form['field_event_date_end']['widget'][0]['value']['#element_validate'], 'social_event_date_validate');
  return $form;
}