You are here

private function SmartDateRecurTrait::massageForOutput in Smart Date 3.3.x

Same name and namespace in other branches
  1. 3.1.x modules/smart_date_recur/src/SmartDateRecurTrait.php \Drupal\smart_date_recur\SmartDateRecurTrait::massageForOutput()
  2. 3.2.x modules/smart_date_recur/src/SmartDateRecurTrait.php \Drupal\smart_date_recur\SmartDateRecurTrait::massageForOutput()
  3. 3.4.x modules/smart_date_recur/src/SmartDateRecurTrait.php \Drupal\smart_date_recur\SmartDateRecurTrait::massageForOutput()

Helper function to massage an array for inclusion in output.

2 calls to SmartDateRecurTrait::massageForOutput()
SmartDateDailyRangeFormatter::viewElements in modules/smart_date_recur/src/Plugin/Field/FieldFormatter/SmartDateDailyRangeFormatter.php
SmartDateRecurTrait::formatWithinDay in modules/smart_date_recur/src/SmartDateRecurTrait.php
Helper function to create a collapsed display of events within a day.

File

modules/smart_date_recur/src/SmartDateRecurTrait.php, line 13

Class

SmartDateRecurTrait
Provides friendly methods for smart date range.

Namespace

Drupal\smart_date_recur

Code

private function massageForOutput($output, array $settings, $add_classes = NULL) {
  if (!$add_classes) {
    $add_classes = $this
      ->getSetting('add_classes');
  }
  if ($settings['date_first']) {

    // Time should be first so reverse the array.
    ksort($output);
  }
  $temp_array['start'] = $output;
  if ($add_classes) {
    $this
      ->addRangeClasses($temp_array);
  }
  return $temp_array['start'];
}