You are here

function date_all_day_field in Date 7.3

Same name and namespace in other branches
  1. 8 date_all_day/date_all_day.module \date_all_day_field()
  2. 7.2 date_all_day/date_all_day.module \date_all_day_field()

Determine if a field qualifies as 'All day'.

Parameters

array $field: The field definition for this date field.

array $instance: The field instance for this date field.

array $value: A date field value.

Return value

bool TRUE or FALSE.

2 calls to date_all_day_field()
date_all_day_date_formatter_dates_alter in date_all_day/date_all_day.module
Implements hook_date_formatter_dates_alter().
hook_date_formatter_dates_alter in ./date.api.php
Alter the dates array created by date_formatter_process().

File

date_all_day/date_all_day.module, line 153
Adds All Day functionality to the Date field.

Code

function date_all_day_field(array $field, array $instance, array $value) {
  if (empty($value)) {
    return FALSE;
  }
  elseif (empty($instance['widget']['settings']['display_all_day'])) {
    return FALSE;
  }

  // As of 7.x-3.x the logic for whether a field counts as "all day" is based
  // purely on this one value.
  return !empty($value['value']['local']['all_day']);
}