You are here

function theme_date_calendar_day in Date 7.2

Same name and namespace in other branches
  1. 8 date_api/theme/theme.inc \theme_date_calendar_day()
  2. 6.2 theme/theme.inc \theme_date_calendar_day()
  3. 7.3 date_api/theme/theme.inc \theme_date_calendar_day()
  4. 7 date_api/theme/theme.inc \theme_date_calendar_day()

Returns HTML for a date block that looks like a mini calendar day.

Pass in a date object already set to the right timezone, format as a calendar page date. The calendar styling is created in CSS.

File

date_api/theme/theme.inc, line 177
Theme files for Date API.

Code

function theme_date_calendar_day($variables) {
  $output = '';
  $date = $variables['date'];
  if (!empty($date)) {
    $output .= '<div class="date-calendar-day">';
    $output .= '<span class="month">' . date_format_date($date, 'custom', 'M') . '</span>';
    $output .= '<span class="day">' . date_format_date($date, 'custom', 'j') . '</span>';
    $output .= '<span class="year">' . date_format_date($date, 'custom', 'Y') . '</span>';
    $output .= '</div>';
  }
  return $output;
}