You are here

function calendar_groupby_times in Calendar 8

Same name and namespace in other branches
  1. 6.2 calendar.module \calendar_groupby_times()
  2. 7.3 calendar.module \calendar_groupby_times()
  3. 7 calendar.module \calendar_groupby_times()
  4. 7.2 calendar.module \calendar_groupby_times()

Default settings array for calendar time grouping.

1 call to calendar_groupby_times()
Calendar::render in src/Plugin/views/style/Calendar.php
Render the display in this style.

File

./calendar.module, line 194

Code

function calendar_groupby_times($type = '') {
  $times = [];
  switch ($type) {
    case 'hour':
      for ($i = 0; $i <= 23; $i++) {
        $times[] = DateTimePlus::datePad($i) . ':00:00';
      }
      break;
    case 'half':
      for ($i = 0; $i <= 23; $i++) {
        $times[] = DateTimePlus::datePad($i) . ':00:00';
        $times[] = DateTimePlus::datePad($i) . ':30:00';
      }
      break;
    default:
      break;
  }
  return $times;
}