function _regcode_date_validate in Registration codes 6.2
Same name and namespace in other branches
- 7.2 regcode.admin.inc \_regcode_date_validate()
- 7 regcode.admin.php \_regcode_date_validate()
Ensure a blank date validates
1 string reference to '_regcode_date_validate'
- regcode_admin_create in ./
regcode.admin.php - Create registration codes form
File
- ./
regcode.admin.php, line 306 - Functions and pages needed for the administration interface for the regcode module.
Code
function _regcode_date_validate($element) {
$blank = TRUE;
foreach (array(
'year',
'month',
'day',
) as $field) {
$blank = $blank && $element[$field]['#value'][0] === '0';
}
if ($blank) {
return TRUE;
}
return date_validate($element);
}