You are here

function date_repeat_rrule_validate in Date 6

Same name and namespace in other branches
  1. 8 date_repeat/date_repeat_form.inc \date_repeat_rrule_validate()
  2. 5.2 date_repeat/date_repeat_form.inc \date_repeat_rrule_validate()
  3. 6.2 date_repeat/date_repeat_form.inc \date_repeat_rrule_validate()
  4. 7.3 date_repeat/date_repeat_form.inc \date_repeat_rrule_validate()
  5. 7 date_repeat/date_repeat_form.inc \date_repeat_rrule_validate()
  6. 7.2 date_repeat/date_repeat_form.inc \date_repeat_rrule_validate()

Build a RRULE out of the form values.

1 string reference to 'date_repeat_rrule_validate'
date_repeat_elements in date_repeat/date_repeat.module
Implementation of hook_elements().

File

date_repeat/date_repeat_form.inc, line 227
Code to add a date repeat selection form to a date field and create an iCal RRULE from the chosen selections.

Code

function date_repeat_rrule_validate($element, &$form_state) {
  include_once './' . drupal_get_path('module', 'date_api') . '/date_api_ical.inc';
  $form_values = $form_state['values'];
  $field_name = $element['#parents'][0];
  $item = $form_values[$field_name]['rrule'];
  $item = date_repeat_merge($item);
  $rrule = date_api_ical_build_rrule($item);
  form_set_value($element, $rrule, $form_state);
}