You are here

function calendar_build_mini_month in Calendar 7

Same name and namespace in other branches
  1. 6.2 calendar_multiday/includes/calendar.inc \calendar_build_mini_month()
  2. 7.2 calendar_multiday/includes/calendar.inc \calendar_build_mini_month()

Build one month.

1 call to calendar_build_mini_month()
calendar_build_calendar in calendar_multiday/includes/calendar.inc
Build calendar

File

calendar_multiday/includes/calendar.inc, line 62
Calendar building functions for the Calendar module.

Code

function calendar_build_mini_month(&$curday, $view, $items) {
  $month = date_format($curday, 'n');
  date_modify($curday, '-' . strval(date_format($curday, 'j') - 1) . ' days');
  $rows = array();
  do {
    $rows = array_merge($rows, calendar_build_mini_week($curday, $view, $items, TRUE));
    $curday_date = date_format($curday, DATE_FORMAT_DATE);
    $curday_month = date_format($curday, 'n');
  } while ($curday_month == $month && $curday_date <= $view->date_info->max_date_date);

  // Merge the day names in as the first row.
  $rows = array_merge(array(
    calendar_week_header($view),
  ), $rows);
  return $rows;
}