You are here

function _office_hours_field_settings_form_validate in Office Hours 7

Implements the #element_validate callback for myfield_field_settings_form().

Verifies the office hours limits. "Please note that this will work as long as the opening hours are not through midnight."

1 string reference to '_office_hours_field_settings_form_validate'
office_hours_field_settings_form in includes/office_hours.field.inc
Implements hook_field_settings_form().

File

includes/office_hours.field.inc, line 243
Implements the office_hours Field.

Code

function _office_hours_field_settings_form_validate($element, &$form_state) {
  if ($element['limitstart']['#value'] > $element['limitend']['#value']) {
    form_error($element['limitstart'], t('%start is later then %end.', array(
      '%start' => $element['limitstart']['#title'],
      '%end' => $element['limitend']['#title'],
    )));
  }
}