You are here

function hook_fullcalendar_process_dates_alter in FullCalendar 8

Same name and namespace in other branches
  1. 8.5 fullcalendar.api.php \hook_fullcalendar_process_dates_alter()
  2. 8.2 fullcalendar.api.php \hook_fullcalendar_process_dates_alter()
  3. 8.3 fullcalendar.api.php \hook_fullcalendar_process_dates_alter()
  4. 8.4 fullcalendar.api.php \hook_fullcalendar_process_dates_alter()
  5. 7.2 fullcalendar.api.php \hook_fullcalendar_process_dates_alter()

Alter the dates after they're loaded, before they're added for rendering.

Parameters

object $date1: The start date object.

object $date2: The end date object.

array $context: An associative array containing the following key-value pairs:

  • instance: The field instance.
  • entity: The entity object for this date.
  • field: The field info.

File

./fullcalendar.api.php, line 101
Hooks provided by the FullCalendar module.

Code

function hook_fullcalendar_process_dates_alter(&$date1, &$date2, $context) {

  // Always display dates only on one day.
  if ($date1
    ->format(DATETIME_DATE_STORAGE_FORMAT) != $date2
    ->format(DATETIME_DATE_STORAGE_FORMAT)) {
    $date2 = $date1;
  }
}