You are here

function date_validate in Drupal 6

Same name and namespace in other branches
  1. 4 includes/form.inc \date_validate()
  2. 5 includes/form.inc \date_validate()
  3. 7 includes/form.inc \date_validate()

Validates the date type to stop dates like February 30, 2006.

Related topics

1 string reference to 'date_validate'
system_elements in modules/system/system.module
Implementation of hook_elements().

File

includes/form.inc, line 1812

Code

function date_validate($element) {
  if (!checkdate($element['#value']['month'], $element['#value']['day'], $element['#value']['year'])) {
    form_error($element, t('The specified date is invalid.'));
  }
}