You are here

function date_is_required in Date 5

Logic for telling when a field value is required.

2 calls to date_is_required()
date_field in ./date.module
Implementation of hook_field().
date_widget in ./date.module
Implementation of hook_widget().

File

./date.module, line 131
Defines a date/time field type.

Code

function date_is_required($field, $column, $delta, $value1, $value2) {
  if ($column == 'value2' && ($field['todate'] == 'required' && ($value1 || $delta == 0))) {
    return TRUE;
  }
  elseif ($column == 'value' && ($field['required'] && $delta == 0)) {
    return TRUE;
  }
  return FALSE;
}