Skip navigation
Help

date_validate

6 form.inc date_validate($element)
7 form.inc date_validate($element)

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

Related topics

1 string reference to 'date_validate'

File

drupal/includes/form.inc, line 2861

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.'));
  }
}