1 date.field.inc date_field_is_empty($item, $field)

Implements hook_field_is_empty().

File

core/modules/date/date.field.inc, line 207
Field hooks to implement a date field.

Code

function date_field_is_empty($item, $field) {
  // Sometimes a $item is a date object.
  // Coming from repeating dates. Why??
  if (!is_array($item)) {
    return FALSE;
  }
  if (empty($item['value'])) {
    return TRUE;
  }
  elseif ($field['settings']['todate'] == 'required' && empty($item['value2'])) {
    return TRUE;
  }
  return FALSE;
}