You are here

function _calendar_setup_form_validate in Calendar 5.2

File

./calendar_admin.inc, line 513
This file contains administrative functions used only when setting up the calendar and views_hooks() that are called infrequently and cached. No need to parse all this code the rest of the time.

Code

function _calendar_setup_form_validate($form_id, $form_values) {
  if (!preg_match('@\\-[0-9]*:[\\+|\\-][0-9]*@', $form_values['calendar_year_range']) && !preg_match('@[0-9]{4}:[0-9]{4}@', $form_values['calendar_year_range'])) {
    form_set_error('calendar_year_range', t('Date year range must be in the format -9:+9 or 2005:2010.'));
  }
}