You are here

function calendar_systems_preprocess_date_display_combination in Calendar Systems 7.2

Same name and namespace in other branches
  1. 8 calendar_systems.module \calendar_systems_preprocess_date_display_combination()
  2. 7 calendar_systems.module \calendar_systems_preprocess_date_display_combination()

Implements hook_preprocess_date_display_combination().

Parameters

$variables:

File

./calendar_systems.module, line 830
Contains Calendar Systems hook implementations and helpers.

Code

function calendar_systems_preprocess_date_display_combination(&$variables) {
  $instance_settings = $variables['display']['settings']['calendar_system'];
  $calendar_system = calendar_systems_get_calendar_system_name();
  if (empty($instance_settings)) {
  }
  elseif ($instance_settings == 'same_as_field_settings') {
    $calendar_system = $variables['field']['settings']['calendar_system'];
  }
  else {
    $calendar_system = $instance_settings;
  }
  if ($calendar_system != 'default') {
    $format = $variables['dates']['format'];
    $date = $variables['dates']['value']['local']['datetime'];
    $variables['dates']['value']['formatted'] = _calendar_systems_fix_display($date, $format, $calendar_system);
    if (isset($variables['dates']['value2'])) {
      $date = $variables['dates']['value2']['local']['datetime'];
      $variables['dates']['value2']['formatted'] = _calendar_systems_fix_display($date, $format, $calendar_system);
    }
  }
}