You are here

function fc_date_field_is_complete in Field Complete 7

Use the date 'empty' hook to see if each entry has content, this also fixes the "todate" bug

1 string reference to 'fc_date_field_is_complete'
date.inc in plugins/fields/date.inc

File

plugins/fields/date.inc, line 19

Code

function fc_date_field_is_complete($items, $instance, $field, &$completed = array()) {
  $module = $field['module'];
  $zero_as_empty = !empty($instance['settings']['fc']['fc_check_zero']);
  $field['settings'] += array(
    'todate' => '',
  );
  foreach ($items as $delta => $item) {
    if (isset($item['value']) && $item['value'] === '0' && $zero_as_empty) {
      $item['value'] = '';
    }
    $completed[$delta] = !module_invoke($module, 'field_is_empty', $item, $field);
  }
}