function date_all_day_date_formatter_dates_alter

cis7 date_all_day.module date_all_day_date_formatter_dates_alter(&$dates, $context)
cle7 date_all_day.module date_all_day_date_formatter_dates_alter(&$dates, $context)
elmsmedia7 date_all_day.module date_all_day_date_formatter_dates_alter(&$dates, $context)
icor7 date_all_day.module date_all_day_date_formatter_dates_alter(&$dates, $context)
meedjum_blog7 date_all_day.module date_all_day_date_formatter_dates_alter(&$dates, $context)
mooc7 date_all_day.module date_all_day_date_formatter_dates_alter(&$dates, $context)

Implements hook_date_formatter_dates_alter().

This allows us to alter the $dates array created by date_formatter_process.

File

sites/all/modules/ulmus/date/date_all_day/date_all_day.module, line 51
Adds All Day functionality to the Date field.

Code

function date_all_day_date_formatter_dates_alter(&$dates, $context) {

  $field = $context['field'];
  $instance = $context['instance'];
  $format = $context['format'];
  $entity_type = $context['entity_type'];
  $entity = $context['entity'];
  $date1 = $dates['value']['local']['object'];
  $date2 = $dates['value2']['local']['object'];

  $is_all_day = date_all_day_field($field, $instance, $date1, $date2);

  $all_day1 = '';
  $all_day2 = '';
  if ($format != 'format_interval' && $is_all_day) {
    $all_day1 = theme('date_all_day', array(
      'field' => $field,
      'instance' => $instance,
      'which' => 'date1',
      'date1' => $date1,
      'date2' => $date2,
      'format' => $format,
      'entity_type' => $entity_type,
      'entity' => $entity,
    ));
    $all_day2 = theme('date_all_day', array(
      'field' => $field,
      'instance' => $instance,
      'which' => 'date2',
      'date1' => $date1,
      'date2' => $date2,
      'format' => $format,
      'entity_type' => $entity_type,
      'entity' => $entity,
    ));
    $dates['value']['formatted_time'] = theme('date_all_day_label');
    $dates['value2']['formatted_time'] = theme('date_all_day_label');
    $dates['value']['formatted'] = $all_day1;
    $dates['value2']['formatted'] = $all_day2;
  }
}
Error | ELMSLN API

Error

×

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/api.elmsln.org/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/api.elmsln.org/sites/all/modules/apc/drupal_apc_cache.inc).
The website encountered an unexpected error. Please try again later.