You are here

function fullcalendar_date_fields in FullCalendar 7

Same name and namespace in other branches
  1. 6.2 fullcalendar.module \fullcalendar_date_fields()
  2. 6 fullcalendar.module \fullcalendar_date_fields()

Find all date fields in this instance.

Field type is not in the $field array we get from field_info_instances(), we need to call field_info_field() to find that.

1 call to fullcalendar_date_fields()
template_preprocess_views_view_node_fullcalendar in ./fullcalendar.module
Prepares variables for template file invoked for node row type.

File

./fullcalendar.module, line 380
Provides a views style plugin for FullCalendar

Code

function fullcalendar_date_fields($entity, $entity_type = 'node') {
  $bundle = '';
  switch ($entity_type) {
    case 'node':
      $bundle = $entity->type;
      break;
  }
  $fields = array();
  foreach (array_keys(field_info_instances($entity_type, $bundle)) as $field_name) {
    $field = field_info_field($field_name);
    if (in_array($field['type'], array(
      'date',
      'datestamp',
      'datetime',
    ))) {
      $fields[$field_name] = $field;
    }
  }
  return $fields;
}