You are here

function christmas_lights_settings_validate in Christmas Lights 7

Form validation handler for christmas_lights_settings().

See also

christmas_lights_settings_submit()

File

./christmas_lights.module, line 70
Main file for the christmas_lights module.

Code

function christmas_lights_settings_validate($form, &$form_state) {
  $start = $form_state['values']['start'];
  $end = $form_state['values']['end'];
  $start = mktime(0, 0, 0, $start['month'], $start['day'], $start['year']);
  $end = mktime(0, 0, 0, $end['month'], $end['day'], $end['year']);
  if ($start >= $end) {
    form_set_error('start', t('You must select a valid start date.'));
  }
}