You are here

function calendar_groupby_times in Calendar 7

Same name and namespace in other branches
  1. 8 calendar.module \calendar_groupby_times()
  2. 6.2 calendar.module \calendar_groupby_times()
  3. 7.3 calendar.module \calendar_groupby_times()
  4. 7.2 calendar.module \calendar_groupby_times()
1 call to calendar_groupby_times()
calendar_view_plugin_style::init in includes/calendar_view_plugin_style.inc
Init will be called after construct, when the plugin is attached to a view and a display.

File

./calendar.module, line 427
Adds calendar filtering and displays to Views.

Code

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