date_validate

  1. drupal
    1. 5
    2. 6
    3. 7
    4. 8
Versions
5 date_validate($form)
6 – 7 date_validate($element)

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

Related topics

Code

includes/form.inc, line 2887

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